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

65 lines
1.5 KiB
Nix
Raw Normal View History

2024-05-18 14:52:39 +05:30
{ extra-packages, ... }:
2024-04-21 23:00:50 +05:30
let
2024-05-18 14:52:39 +05:30
change-wallpaper = "${extra-packages.setpaper}/bin/setpaper";
wallpaper-downloader = "${extra-packages.getpaper}/bin/getpaper";
2024-04-21 23:00:50 +05:30
in
{
2024-04-21 23:45:36 +05:30
systemd.user = {
2024-04-28 13:29:47 +05:30
services = {
wallhaven = {
Unit = {
Description = "Wallpaper Downloader";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session-pre.target" ];
2024-04-28 13:29:47 +05:30
};
Service = {
Type = "oneshot";
ExecStart = "${wallpaper-downloader}";
};
2024-04-21 23:45:36 +05:30
};
2024-04-28 13:29:47 +05:30
wallpaper = {
Unit = {
Description = "Change Wallpaper";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session-pre.target" ];
Wants = "swww-daemon.service";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${change-wallpaper}";
};
2024-04-21 23:45:36 +05:30
};
2024-04-21 23:00:50 +05:30
};
2024-04-28 13:29:47 +05:30
timers = {
wallhaven = {
Unit = {
Description = "Wallpaper Downloader";
};
Install = {
WantedBy = [ "default.target" ];
};
Timer = {
2024-05-15 00:25:39 +05:30
OnCalendar = "00:00:00";
Persistent = true;
2024-04-28 13:29:47 +05:30
};
};
2024-04-28 13:29:47 +05:30
wallpaper = {
Unit = {
Description = "Change Wallpaper";
};
Install = {
WantedBy = [ "default.target" ];
};
Timer = {
OnStartupSec = "10min";
OnUnitActiveSec = "10min";
};
2024-04-21 23:45:36 +05:30
};
2024-04-21 23:00:50 +05:30
};
};
}