1
0
Fork 0

Fix wallpaper unit

This commit is contained in:
Malte Brandy 2020-01-19 18:42:41 +01:00
parent 74c287a996
commit 5f599e235a
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -6,9 +6,9 @@ let
imports = [ "System.Random" ];
bins = [ pkgs.coreutils pkgs.sway ];
} ''
main = forever $ do
files <- fmap (lines . decodeUtf8) $ ls "/home/maralorn/.wallpapers" |> captureTrim
file <- fmap (files Unsafe.!!) $ getStdRandom $ randomR (0, length files - 1)
main = do
(lines . decodeUtf8 -> files) <- ls "/home/maralorn/.wallpapers" |> captureTrim
((files Unsafe.!!) -> file) <- getStdRandom $ randomR (0, length files - 1)
cp ([i|/home/maralorn/.wallpapers/#{file}|] :: String) "/home/maralorn/volatile/wallpaper.jpg"
swaymsg "output * bg /home/maralorn/volatile/wallpaper.jpg fill"
'';
@ -23,7 +23,7 @@ in {
};
};
timers.random-wallpaper = {
Timer = { OnCalendar = "*:*:0/5"; };
Timer = { OnCalendar = "*:00/5:00"; };
Install = { WantedBy = [ "timers.target" ]; };
};
};