-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWallpaperNixosService.nix
More file actions
34 lines (33 loc) · 911 Bytes
/
WallpaperNixosService.nix
File metadata and controls
34 lines (33 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ config, lib, pkgs, ... }:
let
timedRandomWallpaperSetter = pkgs.writeShellScriptBin
"timed-random-wallpaper-setter"
''
# XDG_CONFIG_HOME is not recognized in the environment here.
if [ -f /home/BLAHUSER/.config/WallpaperOpts.nix ]
then
echo "Building wallpaper setter ..."
WPS=$(${pkgs.nix}/bin/nix-build /home/BLAHUSER/.config//WallpaperManager.nix)
echo "Wallpaper setter is $WPS, display is $DISPLAY"
while true
do
$WPS
sleep 60
done
fi
''
;
in
{
systemd.user.services.timed-random-wallpaper-setter = {
wantedBy = [ "default.target" ];
serviceConfig = {
Description = "Timed random wallpaper setter service";
Type = "simple";
ExecStart = "${timedRandomWallpaperSetter}/bin/timed-random-wallpaper-setter";
Restart="on-failure";
RestartSec=3;
RestartPreventExitStatus=3;
};
};
}