Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Hidden and temporary files
.*
!.git*

# Backup files
*~
\#*\#
Expand All @@ -6,6 +10,10 @@
*.o
*.ko

# Auxiliary files
*.gch
*.su

# Libraries
*.lib
*.a
Expand Down
17 changes: 16 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,28 @@ AS_IF([test "x$enable_vidmode" != xno], [
])
AM_CONDITIONAL([ENABLE_VIDMODE], [test "x$enable_vidmode" = xyes])

# Check for fake Windows GDI
AC_MSG_CHECKING([whether to enable fake WinGDI])
AC_ARG_ENABLE([fakegdi], [AC_HELP_STRING([--enable-fakegdi],
[enable fake WinGDI])],
[enable_fakegdi=$enableval],[enable_fakegdi=no])
AS_IF([test "x$enable_fakegdi" != xno], [
AC_DEFINE([FAKE_W32GDI], 1,
[Define to 1 to enable WinGDI method])
AC_MSG_RESULT([yes])
enable_fakegdi=yes
], [
AC_MSG_RESULT([no])
])
AM_CONDITIONAL([FAKE_W32GDI], [test "x$enable_fakegdi" != xno])

# Check Windows GDI method
AC_MSG_CHECKING([whether to enable WinGDI method])
AC_ARG_ENABLE([wingdi], [AC_HELP_STRING([--enable-wingdi],
[enable WinGDI method])],
[enable_wingdi=$enableval],[enable_wingdi=maybe])
AS_IF([test "x$enable_wingdi" != xno], [
AS_IF([test $have_windows_h = yes], [
AS_IF([test $have_windows_h = yes -o $enable_fakegdi = yes], [
AC_DEFINE([ENABLE_WINGDI], 1,
[Define to 1 to enable WinGDI method])
AC_MSG_RESULT([yes])
Expand Down
6 changes: 3 additions & 3 deletions redshift.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
redshift \- Set color temperature of display according to time of day.
.SH SYNOPSIS
.B redshift
\fI[\-l LAT:LON | \-l PROVIDER:OPTIONS] [\-t DAY:NIGHT] \fR[\fIOPTIONS\fR...]
\fI[\-l LAT:LON | \-l PROVIDER OPTIONS] [\-t DAY:NIGHT] \fR[\fIOPTIONS\fR...]
.SH DESCRIPTION
.B redshift
adjusts the color temperature of your screen according to your
Expand Down Expand Up @@ -46,11 +46,11 @@ Your current location, in degrees, given as floating point numbers,
towards north and east, with negative numbers representing south and
west, respectively.
.TP
\fB\-l\fR PROVIDER[:OPTIONS]
\fB\-l\fR PROVIDER [OPTIONS]
Select provider for automatic location updates
(Type `list' to see available providers)
.TP
\fB\-m\fR METHOD
\fB\-m\fR METHOD [OPTIONS]
Method to use to set color temperature
(Type `list' to see available methods)
.TP
Expand Down
9 changes: 8 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ redshift_SOURCES = \
location-manual.c location-manual.h \
solar.c solar.h \
systemtime.c systemtime.h \
gamma-dummy.c gamma-dummy.h
adjustments.h \
gamma-dummy.c gamma-dummy.h \
opt-parser.c opt-parser.h

EXTRA_redshift_SOURCES = \
gamma-drm.c gamma-drm.h \
gamma-randr.c gamma-randr.h \
gamma-vidmode.c gamma-vidmode.h \
gamma-w32gdi.c gamma-w32gdi.h \
fake-w32gdi.c fake-w32gdi.h \
location-geoclue.c location-geoclue.h

AM_CFLAGS =
Expand Down Expand Up @@ -53,8 +56,12 @@ endif

if ENABLE_WINGDI
redshift_SOURCES += gamma-w32gdi.c gamma-w32gdi.h
if FAKE_W32GDI
redshift_SOURCES += fake-w32gdi.c fake-w32gdi.h
else
redshift_LDADD += -lgdi32
endif
endif


if ENABLE_GEOCLUE
Expand Down
55 changes: 55 additions & 0 deletions src/adjustments.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* adjustments.h -- Adjustment constants and data structures header
This file is part of Redshift.

Redshift is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Redshift is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Redshift. If not, see <http://www.gnu.org/licenses/>.

Copyright (c) 2014 Mattias Andrée <maandree@member.fsf.org>
*/

#ifndef REDSHIFT_ADJUSTMENTS_H
#define REDSHIFT_ADJUSTMENTS_H

#include <stdint.h>
#include <unistd.h>



/* Bounds for parameters. */
#define MIN_TEMP 1000
#define MAX_TEMP 25000
#ifndef MIN_BRIGHTNESS
# define MIN_BRIGHTNESS 0.1f
#endif
#if !defined(MAX_BRIGHTNESS) && !defined(NO_MAX_BRIGHTNESS)
# define MAX_BRIGHTNESS 1.0f
#endif
#ifndef MIN_GAMMA
# define MIN_GAMMA 0.1f
#endif
#if !defined(MAX_GAMMA) && !defined(NO_MAX_GAMMA)
# define MAX_GAMMA 10.0f
#endif

/* Default values for parameters. */
#define DEFAULT_DAY_TEMP 5500
#define DEFAULT_NIGHT_TEMP 3500
#define DEFAULT_BRIGHTNESS 1.0f
#define DEFAULT_GAMMA 1.0f

/* The color temperature when no adjustment is applied. */
#define NEUTRAL_TEMP 6500



#endif
Loading