-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically switch between dark/light themes based on time of day. Potential TODO: - add more apps to switch - automatically adjust the time of changes based on location - integrate with geoclue?
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
systemd.user.timers = { | ||
theme-toggle-dark = { | ||
Unit.Description = "Toggle dark theme"; | ||
Timer.OnCalendar = [ | ||
"*-*-* 18:00:00" | ||
]; | ||
Install.WantedBy = ["graphical-session.target"]; | ||
}; | ||
|
||
theme-toggle-light = { | ||
Unit.Description = "Toggle light theme"; | ||
Timer.OnCalendar = [ | ||
"*-*-* 06:00:00" | ||
]; | ||
Install.WantedBy = ["graphical-session.target"]; | ||
}; | ||
}; | ||
|
||
systemd.user.services = { | ||
theme-toggle-dark = { | ||
Unit.Description = "Toggle dark theme"; | ||
Service = { | ||
Type = "simple"; | ||
ExecStart = "${lib.getExe pkgs.dconf} write /org/gnome/desktop/interface/color-scheme \"'prefer-dark'\""; | ||
TimeoutStopSec = 5; | ||
}; | ||
}; | ||
theme-toggle-light = { | ||
Unit.Description = "Toggle light theme"; | ||
Service = { | ||
Type = "simple"; | ||
ExecStart = "${lib.getExe pkgs.dconf} write /org/gnome/desktop/interface/color-scheme \"'prefer-light'\""; | ||
TimeoutStopSec = 5; | ||
}; | ||
}; | ||
}; | ||
} |