LinuxCommandLibrary

redshift

Adjust screen color temperature based on time

TLDR

Turn on Redshift with a specific [t]emperature during day (e.g., 5700K) and at night (e.g., 3600K)

$ redshift -t [5700]:[3600]
copy

Turn on Redshift with a manually specified custom [l]ocation
$ redshift -l [latitude]:[longitude]
copy

Turn on Redshift with a specific screen [b]rightness during the day (e.g, 70%) and at night (e.g., 40%)
$ redshift -b [0.7]:[0.4]
copy

Turn on Redshift with custom [g]amma levels (between 0 and 1)
$ redshift -g [red]:[green]:[blue]
copy

[P]urge existing temperature changes and set a constant unchanging color temperature in [O]ne-shot mode
$ redshift -PO [temperature]
copy

SYNOPSIS

redshift [OPTIONS]
redshift -l LAT:LON -t DAY:NIGHT

PARAMETERS

-h, --help
    Displays a help message and exits.

-V, --verbose
    Enables verbose output, showing more details about operations.

-O TEMP, --one-shot TEMP
    Sets the color temperature to TEMP (in Kelvin) once and then exits. Useful for quick manual adjustments.

-x, --print
    Prints the current color temperature to standard output and exits.

-l LAT:LON, --location LAT:LON
    Manually sets the geographical location using latitude and longitude (e.g., 59.9:10.8). This overrides location providers.

-l PROVIDER, --location-provider PROVIDER
    Specifies the location provider to use (e.g., geoclue2, manual). Default is usually geoclue2 if available.

-t DAY:NIGHT, --temperature DAY:NIGHT
    Sets the color temperatures for day and night in Kelvin (e.g., 6500:3700). 6500K is standard daylight, lower values are warmer.

-b DAY:NIGHT, --brightness DAY:NIGHT
    Sets the brightness for day and night (e.g., 1.0:0.8). Value 1.0 means no change. Note: this applies a gamma adjustment, not true backlight control.

-g R:G:B, --gamma R:G:B
    Sets gamma correction for red, green, and blue channels (e.g., 0.8:0.9:1.0). Can be used to fine-tune colors.

-m METHOD, --method METHOD
    Specifies the method for setting color temperature. Common methods include randr (X11), vidmode (older X11), or wayland.

DESCRIPTION

redshift is a program that adjusts the color temperature of your screen according to your surroundings. This helps to reduce eye strain and improve sleep quality by reducing the amount of blue light emitted by your display during evening and night hours.

The program takes your geographical location into account to determine the time of day and automatically transitions the screen's color temperature from a daylight setting to a warmer, redder tone as sunset approaches and through the night. It can run continuously in the background, applying smooth transitions. Users have extensive control over configuration, including specifying manual color temperatures, location coordinates, and various brightness/gamma settings, making it a highly customizable tool for eye comfort.

CAVEATS

redshift's ability to adjust brightness and gamma might be limited by your display driver or desktop environment. On some Wayland compositors, direct color temperature adjustment might not be fully supported or require specific configuration. Users might experience flickering or unexpected behavior if the display method or driver interactions are not harmonious. Ensure location services like Geoclue are properly set up if using automatic location detection.

CONFIGURATION FILE

For persistent settings and more advanced options, redshift reads from a configuration file, typically located at ~/.config/redshift/redshift.conf. This file allows users to define default temperatures, brightness levels, location providers, and even specific settings per screen or monitor, without needing to pass numerous command-line arguments each time redshift is launched.

DAEMON MODE AND AUTOSTART

By default, when run without the --one-shot option, redshift operates as a daemon, continuously monitoring the time of day and smoothly transitioning the screen's color temperature. For automatic operation upon system startup, it is common practice to add redshift to a desktop environment's autostart applications or run it as a systemd user service.

HISTORY

Inspired by proprietary applications like f.lux, redshift was developed by Jon Lund Steffensen, with initial public releases appearing around 2009-2010. Its aim was to provide a free and open-source solution for adjusting screen color temperature on Linux and BSD systems. Over the years, it has evolved to support various display environments, including X11 (via RandR and Vidmode) and more recently Wayland, adapting to the changing Linux graphics stack and striving for wider compatibility.

SEE ALSO

sct(1), xrandr(1), xbacklight(1), gsettings(1)

Copied to clipboard