30 lines
614 B
Nix
30 lines
614 B
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
wallpaperWatch = pkgs.writeShellScriptBin "wallpaper-watch"
|
|
(builtins.readFile ../scripts/wallpaper-watch.sh);
|
|
in
|
|
{
|
|
home.packages = [
|
|
wallpaperWatch
|
|
];
|
|
|
|
systemd.user.services.wallpaper-watcher = {
|
|
Unit = {
|
|
Description = "Dynamic wallpaper watcher";
|
|
After = [ "graphical-session.target" ];
|
|
PartOf = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Service = {
|
|
ExecStart = "${wallpaperWatch}/bin/wallpaper-watch";
|
|
Restart = "always";
|
|
RestartSec = 2;
|
|
};
|
|
|
|
Install = {
|
|
WantedBy = [ "graphical-session.target" ];
|
|
};
|
|
};
|
|
}
|