configuration.nix/home/wm/addon/wallpaper.nix

37 lines
863 B
Nix
Raw Normal View History

2024-04-21 23:00:50 +05:30
{ config, pkgs, ... }:
let
pictures = "${config.xdg.userDirs.pictures}";
change-wallpaper = "${pkgs.scripts}/bin/chpaper ${pictures}/Wallpapers";
in
{
2024-04-21 23:45:36 +05:30
systemd.user = {
services.wallpaper = {
Unit = {
Description = "Change Wallpaper";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session-pre.target" ];
Wants = "swww-daemon.service";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
2024-04-21 23:45:36 +05:30
Service = {
Type = "oneshot";
ExecStart = "${change-wallpaper}";
};
2024-04-21 23:00:50 +05:30
};
2024-04-21 23:45:36 +05:30
timers.wallpaper = {
Unit = {
Description = "Change Wallpaper";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
2024-04-21 23:45:36 +05:30
Timer = {
OnStartupSec = "10min";
OnUnitActiveSec = "10min";
};
2024-04-21 23:00:50 +05:30
};
};
}