Refactor gui module
This commit is contained in:
parent
edfe0e5bf9
commit
e65183b4a4
36 changed files with 236 additions and 309 deletions
43
home/david/modules/programs/waypaper.nix
Normal file
43
home/david/modules/programs/waypaper.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.david.programs.waypaper;
|
||||
in {
|
||||
options = {
|
||||
david.programs.waypaper = {
|
||||
enable = lib.mkEnableOption "waypaper";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = with pkgs; [waypaper socat mpvpaper];
|
||||
systemd.user = {
|
||||
timers."waypaper" = {
|
||||
Unit = {
|
||||
Description = "Set a random wallpaper every 10 minutes";
|
||||
};
|
||||
Timer = {
|
||||
Persistent = true;
|
||||
OnCalendar = "*:0/10";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["timers.target"];
|
||||
};
|
||||
};
|
||||
services."waypaper" = {
|
||||
Unit = {
|
||||
Description = "Set a random wallpaper with waypaper";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = lib.escapeShellArgs [
|
||||
(lib.getExe pkgs.waypaper)
|
||||
"--random"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue