aboutsummaryrefslogtreecommitdiffstats
path: root/README
blob: 77d0b9fa9bb7f92665f1a11c9657d1d0c6ac58ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
PROLOGUE
	redshift-ng is a fork Redshift. redshift-ng strives to keep backwards
	compatibility with Redshift and be usable as a drop-in replacement.
	Therefore, redshift-ng implements the command "redshift" just like the
	original Redshift implementation.

NAME
	redshift - Automatically adjust display colour temperature according the Sun

SYNOPSIS
	redshift [-b brightness] [-c file] [-D | +D] [-g gamma]
	         [-l latitude:longitude | -l provider[:options]]
	         [-m method[:options]] [-P | +P] [-r | +r] [-dv]
	         [-O temperature | -o | -p | -t temperature | -x]

	redshift -h

	redshift -V

DESCRIPTION
	redshift adjusts the colour temperature of your screen according to your
	surroundings. This may help your eyes hurt less or reduce the risk for
	delayed sleep phase syndrome if you are working in front of the screen
	at night.

	The colour temperature is set according the the position of the Sun.
	A different colour temperature is set during the night and during the
	day. During dawn and early morning, the colour temperature transitions
	smoothly from night- to day-time temperature to allow your eyes to
	slowly adapt over a period of about an hour. At night, the colour
	temperature should be set to match the maps in your room. This is
	typically a low temperature at around 3000K–4000K (default is 4500K).
	During the day, the colour temperature should match the light from
	outside. Typically around 5500K–6500K (default is 6500K). The light has
	a lower temperature on an overcast day.

	In addition to the command-line tool redshift, the GUI redshift-gtk
	provides an alternative interface that shows up as a notification icon
	in the desktop environment.

OPTIONS
	The following options are supported:

	-b brightness
		Synonym for "-b brightness:brightness".

	-b day:night
		Screen brightness to apply at daytime and at nighttime.
		(Default: 1:1)

		The values most be between 0.1 and 1.0.

		day or night may be omitted, to keep unmodified, however
		at least one must be specified.

	-c file
		Load settings from specified configuration file.

	-D
		Start in enabled state. (Default)

	+D
		Start in disabled state.

		Ignored in one-shot mode.

	-d
		Keep the process alive and remove the colour effects
		when killed.

		Ignored for -p and -x; always active for -t and the
		"quartz" adjustment method.

	-g gamma
		Synonym for "-g gamma:gamma".

	-g day:night
		Synonym for "-g day:day:day:night:night:night".

	-g r:g:b
		Synonym for "-g r:g:b:r:g:b".

	-g day-r:day-g:day-b:night-r:night-g:night-b
		Additional gamma correction to apply at daytime and
		at nighttime. (Default: 1:1:1:1:1:1)

		The values most be between 0.1 and 10.0.

		day-r:day-g:day-b or night-r:night-g:night-b may be omitted,
		to keep unmodified, however at least one set must be specified.
		Individual components of one set cannot be omitted, either
		nothing is omitted or an entire set, including its two colons
		(:) are omitted.

	-h
		Display help message.

	-l latitude:longitude
		Your current location, in degrees. Shall be formatted a single
		real number, rather than split into integer degrees, minutes
		and seconds. The location should be specified using the GPS
		coordinate system.

	-l provider[:options]
		Select provider for automatic location updates.

		Use "-l list" to see available providers.

		Use "-l provider:help" to see available options.

	-m method[:options]
		Method to use to set colour temperature.

		Use "-m list" to see available methods.

		Use "-m method:help" to see available options.

	-O temperature
		This is a synonym for "-O temperature:temperature".

	-O day:night
		One-shot manual mode (set colour temperature). The colour set
		is interpolated between day and night depending on the Sun's
		elevation or the clock time (depending on which redshift is
		configured to use).

		Values must be at least 1000 and integral.

		Use this with the -P option to clear the existing gamma ramps
		before applying the new color temperature.

		This is a synonym for "-t day:night -o".

	-o
		One-shot mode (do not continuously adjust colour temperature).

		Use this with the -P option to clear the existing gamma ramps
		before applying the new color temperature.

	-P
		Reset exiting gamma ramps before applying new colour effects.

	+P
		Preserve preexisting gamma adjustments. (Default)

	-p
		Print parameter and exit.

	-r
		Disable fading between colour temperatures.

	+r
		Enable fading between colour temperatures. (Default)

	-t temperature
		This is a synonym for "-t temperature:temperature".

	-t day:night
		Colour temperature to set at daytime and at nighttime.

		Values must be at least 1000 and integral.

	-V
		Show program implementation and verison.

	-v
		Enable verbose output.

	-x
		Remove adjustments from screen.

	For mutually exclusive options or options specified multiple times,
	the last specified takes effect, except the first specified option
	that outputs text (except -p) is used. However, if the daytime
	value or nighttime value is omitted for an option, the last previously
	specified value will be used; that is, for example, "-t 5000:" and
	"-t :3000" do not override each other, but "-t 5000:" overrides,
	if specified later, "6000" but not "3000" in "-t 6000:3000".

	Options in the command line override settings from the configuration
	file.

OPERANDS
	None.

STDIN
	Not used.

INPUT FILES
	None.

ASYNCHRONOUS EVENTS
	redshift takes the standard action for all signals except:

	SIGINT, SIGTERM, SIGQUIT
		Smoothly disable the effects of redshift and terminate the
		process. If already sent, immediately disable the effects
		and terminate the process.

	SIGUSR1
		Disable the effects of redshift, or if already disabled,
		reenable them.

STDOUT
	The standard output is used to print state information and requested
	help information. The output is subject to localisation, and the
	following formats apply for the "C" locale. Applications taking use
	of this information must make sure to set the message locale to "C".
	For floating-point values ("%f") the precision is not documented as
	it may change between versions and applications should not expect any
	particular precision to be used.

	When "-m list" is specified the available gamma ramp adjustment methods
	are printed with the header "Available adjustment methods:\n" followed
	by the list in the format

		"%s%s\n", <arbitrary whitespace>, <method name>.

	The list is terminated by an empty line. Additional information for
	human users is printed after the empty line.

	When "-l list" is specified  the available location providers are
	printed with the header "Available location providers:\n" followed by
	the list in the format

		"%s%s\n", <arbitrary whitespace>, <provider name>.

	The list is terminated by an empty line. Additional information for
	human users is printed after the empty line.

	When "-m method:help", "-l provider:help", or "-h" is specified help
	information is printed on in unspecified format, intended only for
	human users.

	When "-V" is specified, the used version of the program is printed to
	the standard output in the format

		"%s %s\n", <implementation name>, <version number>.

	If "-v" is specified and the colour settings depend on the Sun's
	elevation, the elevation thresholds are printed to the standard
	output in the format

		"Solar elevations: day above %f, night below %f\n",
		<minimum solar elevation at daytime>,
		<maximum solar elevation at nighttime>.

	This line may be printed, if "-v" is specified, if redshift is
	configured.

	If "-v" is specified and the colour settings depend on the clock time,
	the time schedule is printed to the standard output, with the header

	These lines may be printed, if "-v" is specified, if redshift is
	configured.

	If "-v" is specified, the colour settings is printed to the standard
	output in the format

		"Temperatures: %luK at day, %luK at night\n"
		"Brightness: %f:%f\n"
		"Gamma (Daytime): %f, %f, %f\n"
		"Gamma (Night): %f, %f, %f\n",
		<daytime colour temperature>, <nighttime temperature>,
		<daytime whitepoint brightness>, <nighttime brightness>,
		<daytime red gamma>, <daytime green gamma>,
		<daytime blue gamma>, <nighttime red gamma>,
		<nighttime green gamma>, <nighttime blue gamma>.

	Each line may be printed, if "-v" is specified, if redshift is
	configured.

	If the colour effects depend on the Sun's elevation, the user's
	geographical location will printed to the standard output in the
	format

		"Location: %f %c, %f %c\n",
		fabs(<GPS latitude>), signbit(<GPS latitude>) ? 'S' : 'N',
		fabs(<GPS longitude>), signbit(<GPS longitude>) ? 'W' : 'E'.

	This message is printed when the program starts and any time the
	location is updated.

	If the colour effects are non-static, the current period of the day
	(which determine the colour effects) is printed to standard output,
	if "-v" or "-p" is specified, in the format

		"Period: %s\n", <period>

	where <period> is "None", "Daytime", or "Night", or in the format

		"Period: Transition (%f%% day)", <dayness level>.

	<dayness level> is exclusively between 0 (night) and 1 (daytime).

	This message is printed when the program starts and any time it
	changes (if "-v" is specified).

	If "-v" or "-p" is specified, the colour settings are printed to the
	standard output when the program standard and any time it changes
	(fade effect is ignored). These are printed in three different
	messages and, on chagne, only the settings that changed are printed:

		"Color temperature: %luK\n", <colour temperature>;

		"Brightness: %f\n", <whitepoint brightness level (0-1)>;

		"Gamma: %f, %f, %f\n", <red gamma>, <green gamma>, <blue gamma>.

	If "-v" is specified, and if running and continual mode, the program
	will print "Status: Enabled\n" if starting in or when entering enabled
	mode, and "Status: Disabled\n" if starting in or when entering disabled
	mode.

	If the "dummy" gamma ramp adjustment method is used, any time a colour
	change is applied (including each fade step), the colour temperature
	is output, for debugging purposes (brightness and gamma are not printed),
	to the standard output in the format

		"Temperature: %lu\n", <colour temperature>.

STDERR
	Default.

OUTPUT FILES
	None.

FILES
	TODO

EXTENDED DESCRIPTION
   Gamma ramps
	redshift applies a redness effect to the graphical display. The
	intensity of the redness can be customised and scheduled to only be
	applied at night or to be applied with more intensity at night.

	redshift uses colour correction lookup tables (CLUTs), usually called
	gamma ramps or gamma correction ramps, to apply this effect.

   Colour temperature
	The redness effect applies by redshift is modelled after black-body
	radiation, specifically with a 10 degree observer. Although black-body
	radiation starts at 0, redshift's model start at the conventional 1000K
	(1000 Kelvin). For this reason, no colour temperature below 1000K can be
	specified. However, as there is a limit can be determined for the colour
	when the colour temperature appreciates infinity, the upper limit for
	allow colour temperature is instead determined by the data type it is
	stored in. However, it also means that it is meaningless to use colour
	temperatures above 40000K.

	The sRGB colour space, and modern monitors, use the standard illuminant
	D65 as the reference for pure white, modelling ideal day light. The
	correlated colour temperature of D65 is called 6500K, however it's
	actually 6504K, but redshift's defines this illuminant has having the
	colour temperature 6500K. This means that 6500K is the neutral (no
	effect) colour temperature.

	The current version redshift assumes the monitor uses sRGB. However
	this is usually only true for CRT monitors. HDR-capable monitors
	particular diverges significant for sRGB. This means that the display
	colour does not perfectly correlated to the specified colour temperate.
	Lower (more red) colour temperatures, about 1900K and below, are out of
	gamut, and thus incorrect even on sRGB monitors.

EXIT STATUS
	Default.

EXAMPLES
	TODO

KNOWN ISSUES
   No or incorrect effect on cursor
	Some graphics drivers apply the effect (colour corrects) twice or not at
	all on hardware cursors. It is often possible to reconfigure the display
	server to use software cursors, to avoid this problem, however at mouse
	pointer performance cost that may be noticeable on very low-end computer.

   D65-flashes
	For some versions of some graphics drivers, there will be an occasional
	flash where gamma ramps are not applied to the output.

   Limited hardware support
	Low-end hardware, especially embedded devices, often lack colour
	correction features redshift abuse to apply it's affect. redshift is not
	always able to tell if support is missing.

   Limited software support
	redshift does not yet support Waylaid. If your environment contains the
	variable WAYLAND_DISPLAY, you are using a Wayland compositor and cannot
	currently expect redshift to work. Even with Wayland support, it would
	be up to each individual Wayland compositor to opt in to support
	applications like redshift.

   Backlight control
	redshift uses gamma ramps rather than backlight control to adjust
	brightness. This actually intentional and for your best. Most
	contemporary monitors require Pulse-Width Modulation, which causes
	flicker than can cause eye-strain and headaches, to adjust backlight.
	Using gamma ramps is a safe option, it's also considerably less work
	basically no extra code and posses no additional limitations. It's often
	not possible to adjust backlight on desktop monitors from software, for
	devices for which it is possible (mostly telephones and laptops, however
	not all have fine-grained enough configurability to be usable) it's not
	possible from software to determine well enough how changing the
	backlight settings changes the backlight physically. If you still want
	backlight to be controlled, you can hook in a tool such as
	adjbacklight(1).

   Flickering and temporary suspension
	redshift uses the gamma ramps for the monitor to apply it's effect. The
	gamma ramps where originally intended for colour correction. Therefore
	there is no standardised why have multiple applications applying
	different effects without overriding each other. This can cause
	continuous flicker if multiple instance are running or effects
	temporarily disappearing. By default, redshift uses coopgammad, which is
	a daemon applications can opt to use instead of directly setting the
	gamma ramps themselves, coopgammad can then calculate the result of all
	of the effects and apply them as one, allowing the user to use multiple
	applications that apply different effects. However coopgammad still has
	to compete with applications that does not use it.

   DRM and display servers
	Using the DRM gamma ramp adjustment method can block starting or
	switching to and already started display server (like X). Users may
	also find that trying to switch to and an already started display cases
	the computer hang, or more precisely appear to hang, as the display
	server is not beign presented, the screen freezes, and the keyboard
	doesn't do anything. (Once upon a time, this wasn't as catastrophic,
	and it probably depend on display server implementation details.) The
	only solution, abort from restarting the computer, is to remote into
	it and kill the display server.

RATIONALE
	To prevent the user from accidental making the screen black, brightness
	level below 0.1 are forbidden.

	To prevent colour distortion and making the screen too white, brightness
	level above 1.0 are forbidden.

NOTES
	"Colour temperature", or just "temperature", is actually short for
	"correlated colour temperature". (Your monitor is not a black-body
	radiator.) And specifically the correlated colour temperature of the
	monitor's whitepoint.

	It's common for users to miss to specify a coordinate as negative,
	which, if missed on the longitude can swap day and night. The latitude
	is negative on the southern hemisphere and the longitude is negative on
	the western hemisphere.

SEE ALSO
	cg-tools(7), coopgammad(1), radharc(1)