Redshift: Difference between revisions
No edit summary |
No edit summary |
||
| Line 68: | Line 68: | ||
"-m randr" | "-m randr" | ||
]; | ]; | ||
tray = false; | |||
}; | }; | ||
| Line 82: | Line 85: | ||
The Home Manager options are defined in the [https://nix-community.github.io/home-manager/options.xhtml#opt-services.gammastep.enable Home Manager Options Manual]. | The Home Manager options are defined in the [https://nix-community.github.io/home-manager/options.xhtml#opt-services.gammastep.enable Home Manager Options Manual]. | ||
The global options | The global options can be found under [https://search.nixos.org/options?query=services.redshift services.redshift]. | ||
==== Usage ==== | ==== Usage ==== | ||
Revision as of 05:06, 28 November 2025
Redshift is an open-source software application designed to adjust the color temperature of computer displays based on the time of day. Created by Jon Lund Steffensen, Redshift modifies the color temperature to reduce eye strain and improve sleep patterns. This application aims to provide a more comfortable viewing experience by dynamically changing the display's color temperature to match the user's surrounding light conditions.
It does this by gradually shifting the color temperature of the display from cooler (bluer) tones during the day to warmer (redder) tones at night.
Users have the flexibility to customize various settings in Redshift. They can specify custom values for day and night color temperatures, adjust the speed of color transitions, and temporarily disable or manually adjust the color temperature.
Installation
Using nix-shell
$ nix-shell -p redshift
Using Global Configuration
environment.systemPackages = [
pkgs.redshift
];
After modifying your configuration, apply the changes by running:
$ sudo nixos-rebuild switch
Using Home Configuration
home.packages = [
pkgs.redshift
];
After updating your configuration, apply the changes by running:
$ home-manager switch
Configuration
Basic
services.redshift = {
enable = true;
temperature = {
day = 5500;
night = 3700;
};
};
services.geoclue2.enable = true;
location.provider = "geoclue2";
Advanced (Home Manager)
services.redshift = {
enable = true;
# Display temperature settings
temperature = {
day = 5700;
night = 3500;
};
# Location settings (replace with your coordinates)
latitude = "27.9880614";
longitude = "86.92521";
# Schedule settings
dawnTime = "6:00-7:45";
duskTime = "18:35-20:15";
# General settings
brightness = {
day = "1";
night = "0.8";
};
extraOptions = [
"-v"
"-m randr"
];
tray = false;
};
# Setting the location works either by using a provider
services.geoclue2.enable = true;
location.provider = "geoclue2";
# Or like this, which can also be set in services.redshift
location.latitude = "27.9880614";
location.longitude = "86.92521";
Tips and Tricks
Location of Options
The Home Manager options are defined in the Home Manager Options Manual.
The global options can be found under services.redshift.
Usage
# If services.redshift.enable is true, the systemd unit redshift.service is provided.
# It can either be started by the user level service manager like this:
systemctl --user start redshift
# Or permanantly enabled by creating the empty file
~/.config/systemd/user/default.target.wants/redshift.service
# After starting the service, make sure to check its status in the service manager:
systemctl --user status redshift
Troubleshooting
Provider is unable to determine location
It may happen that Redshift gets stuck at "Waiting for initial location to become available..." when using the geoclue2 location provider. This may happen when Geoclue is unable to determine your location due to missing information. In that case, you may resort to setting the location manually or using an alternate location service such as beaconDB, which can take advantage of WiFi scanning.
An example of using beaconDB as an alternative:
location.provider = "geoclue2";
services.geoclue2 = {
enable = true;
geoProviderUrl = "https://api.beacondb.net/v1/geolocate";
};