feat: added night light as a dconf option
This commit is contained in:
parent
c81fa77a29
commit
ee6d48fe49
3 changed files with 56 additions and 0 deletions
|
@ -8,6 +8,14 @@
|
||||||
{
|
{
|
||||||
colorScheme = "prefer-dark";
|
colorScheme = "prefer-dark";
|
||||||
accentColor = "slate";
|
accentColor = "slate";
|
||||||
|
clockFormat = "24h";
|
||||||
|
nightLight = {
|
||||||
|
enable = true;
|
||||||
|
automatic = false;
|
||||||
|
fromTime = 12.0;
|
||||||
|
toTime = 11.999999999999;
|
||||||
|
temperature = 2700;
|
||||||
|
};
|
||||||
extraWindowControls = true;
|
extraWindowControls = true;
|
||||||
extensions = {
|
extensions = {
|
||||||
dash-to-panel = {
|
dash-to-panel = {
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
extraWindowControls = true;
|
extraWindowControls = true;
|
||||||
colorScheme = "prefer-dark";
|
colorScheme = "prefer-dark";
|
||||||
clockFormat = "24h";
|
clockFormat = "24h";
|
||||||
|
nightLight = {
|
||||||
|
enable = true;
|
||||||
|
automatic = false;
|
||||||
|
fromTime = 12.0;
|
||||||
|
toTime = 11.999999999999;
|
||||||
|
temperature = 2700;
|
||||||
|
};
|
||||||
extensions = {
|
extensions = {
|
||||||
dash-to-dock = {
|
dash-to-dock = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -81,6 +81,36 @@ in {
|
||||||
description = "GNOME experimental features to enable";
|
description = "GNOME experimental features to enable";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nightLight = lib.mkOption {
|
||||||
|
type = lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
enable = lib.mkEnableOption "night light (blue light filter)";
|
||||||
|
automatic = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to automatically schedule night light based on sunset/sunrise";
|
||||||
|
};
|
||||||
|
fromTime = lib.mkOption {
|
||||||
|
type = lib.types.float;
|
||||||
|
default = 20.0;
|
||||||
|
description = "Start time for night light in 24-hour format (e.g., 20.0 for 8:00 PM)";
|
||||||
|
};
|
||||||
|
toTime = lib.mkOption {
|
||||||
|
type = lib.types.float;
|
||||||
|
default = 6.0;
|
||||||
|
description = "End time for night light in 24-hour format (e.g., 6.0 for 6:00 AM)";
|
||||||
|
};
|
||||||
|
temperature = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 4000;
|
||||||
|
description = "Color temperature for night light (1000-10000K, lower is warmer)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
default = {};
|
||||||
|
description = "Night light configuration";
|
||||||
|
};
|
||||||
|
|
||||||
extensions = {
|
extensions = {
|
||||||
dash-to-dock = {
|
dash-to-dock = {
|
||||||
enable = lib.mkEnableOption "Dash to Dock extension";
|
enable = lib.mkEnableOption "Dash to Dock extension";
|
||||||
|
@ -123,6 +153,17 @@ in {
|
||||||
lib.optional config.gnome.experimentalFeatures.scaleMonitorFramebuffer "scale-monitor-framebuffer"
|
lib.optional config.gnome.experimentalFeatures.scaleMonitorFramebuffer "scale-monitor-framebuffer"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Night light configuration
|
||||||
|
(lib.mkIf config.gnome.nightLight.enable {
|
||||||
|
"org/gnome/settings-daemon/plugins/color" = {
|
||||||
|
night-light-enabled = true;
|
||||||
|
night-light-schedule-automatic = config.gnome.nightLight.automatic;
|
||||||
|
night-light-schedule-from = lib.mkIf (!config.gnome.nightLight.automatic) config.gnome.nightLight.fromTime;
|
||||||
|
night-light-schedule-to = lib.mkIf (!config.gnome.nightLight.automatic) config.gnome.nightLight.toTime;
|
||||||
|
night-light-temperature = config.gnome.nightLight.temperature;
|
||||||
|
};
|
||||||
|
})
|
||||||
(
|
(
|
||||||
lib.mkMerge (
|
lib.mkMerge (
|
||||||
builtins.map (value: let
|
builtins.map (value: let
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue