Redshift: Difference between revisions
mNo edit summary |
Updated Page |
||
| Line 19: | Line 19: | ||
];|name=/etc/nixos/home.nix|lang=nix}} | ];|name=/etc/nixos/home.nix|lang=nix}} | ||
== Configuration == | == Configuration == | ||
==== | ==== Global Configuration: ==== | ||
Options may be found under [https://search.nixos.org/options?query=services.redshift services.redshift]. For more options for configuring Geoclue, check the [[Geoclue|Geoclue page]].{{File|3=services.redshift = { | Options may be found under [https://search.nixos.org/options?query=services.redshift services.redshift]. For more options for configuring Geoclue, check the [[Geoclue|Geoclue page]].{{File|3=services.redshift = { | ||
enable = true; | enable = true; | ||
| Line 31: | Line 31: | ||
location.provider = "geoclue2";|name=/etc/nixos/configuration.nix|lang=nix}} | location.provider = "geoclue2";|name=/etc/nixos/configuration.nix|lang=nix}} | ||
==== | ==== Home Manager ==== | ||
===== Example Usage: ===== | |||
You can find more options in [https://nix-community.github.io/home-manager/options.xhtml#opt-services.redshift.enable Home Manager: services.redshift]. This configuration defines the temperature the display will use at night and day, the schedule and length of the transition, brightness for the display to use, and whether it will use a tray icon. <code>extraOptions</code> defines additional command-line arguments to pass to <code>redshift</code>. | |||
{{File|3=services.redshift = { | {{File|3=services.redshift = { | ||
enable = true; | enable = true; | ||
# Display temperature settings | # Display temperature settings (in Kelvin) | ||
temperature = { | temperature = { | ||
day = | day = 5500; | ||
night = 3500; | night = 3500; | ||
}; | }; | ||
# Schedule settings | # Schedule settings | ||
| Line 49: | Line 48: | ||
duskTime = "18:35-20:15"; | duskTime = "18:35-20:15"; | ||
# | # Brightness | ||
brightness = { | brightness = { | ||
day = "1"; | day = "1"; | ||
| Line 59: | Line 58: | ||
"-m randr" | "-m randr" | ||
]; | ]; | ||
# Tray Icon | |||
tray = false; | |||
};|name=/etc/nixos/home.nix|lang=nix}} | |||
===== Location Based ===== | |||
You can choose to use Redshift with location based screen temperature to match when the sun actually sets and rises in your area. Below are examples of those options using [https://gitlab.freedesktop.org/geoclue/geoclue/-/wikis/home Geoclue] and manually set coordinates. | |||
====== Geoclue: ====== | |||
With Geoclue as the location provider, Geoclue provides location using GPS, 3G modems, GeoIP, and WiFi Geolocation. Some of which may require additional setup.{{File|3=services.redshift = { | |||
enable = true; | |||
provider = "geoclue2"; | |||
};|name=/etc/nixos/home.nix|lang=nix}}You will also need to enable Geoclue in your global configuration [[Geoclue|(See options on the Geoclue page)]]. | |||
{{File|3=services.geoclue2.enable = true; | |||
location.provider = "geoclue2";|name=/etc/nixos/configuration.nix|lang=nix}} | |||
====== Coordinates: ====== | |||
{{File|3=services.redshift = { | |||
enable = true; | |||
# Coordinates based location | |||
provider = "manual"; | |||
latitude = "27.9880614"; | |||
longitude = "86.92521"; | |||
};|name=/etc/nixos/home.nix|lang=nix}} | |||
location | Instead of declaring your coordinates in Redshift, you can also declare them globally for your device in your global configuration: | ||
{{File|3=location = { | |||
provider = "manual"; | |||
latitude = "27.9880614"; | |||
longitude = "86.92521"; | |||
};|name=/etc/nixos/configuration.nix|lang=nix}} | |||
== | ===== Manual Times: ===== | ||
==== | This will have the timings based on time of day. | ||
{{File|3=services.redshift = { | |||
enable = true; | |||
# Schedule settings | |||
dawnTime = "6:00-7:45"; | |||
duskTime = "18:35-20:15"; | |||
};|name=/etc/nixos/home.nix|lang=nix}} | |||
== Troubleshooting == | == Troubleshooting == | ||