1
0
Fork 0

Make mode-switching more resistant

This commit is contained in:
Malte Brandy 2021-10-26 23:06:34 +02:00
parent 0651ca9625
commit bf96b9a6bf
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -20,11 +20,13 @@ in
getMode :: IO Text
getMode = decodeUtf8 <$> (cat "${modeFile}" |> captureTrim)
wallpaperCmd = "random-wallpaper"
main = do
mode <- getMode
say [i|Switching to mode #{mode}...|]
exe ([i|${modeDir}/#{mode}/activate|] :: String)
ignoreFailure $ exe "random-wallpaper"
whenM (elem wallpaperCmd <$> pathBins) $ exe wallpaperCmd
'';
updateModes = pkgs.writeHaskellScript
{