1
0
Fork 0

Update mode location

This commit is contained in:
Malte Brandy 2020-05-22 01:10:41 +02:00
parent bc341930bd
commit 47cec2c8a7
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
2 changed files with 3 additions and 3 deletions

View file

@ -7,7 +7,7 @@ let
bins = [ pkgs.coreutils pkgs.glib ];
} ''
main = do
mode <- cat "/home/maralorn/tmp/mode" |> captureTrim
mode <- cat "/home/maralorn/volatile/mode" |> captureTrim
(lines . decodeUtf8 -> files) <- ls ([i|/home/maralorn/.wallpapers/#{mode}|] :: String) |> captureTrim
((files Unsafe.!!) -> file) <- getStdRandom $ randomR (0, length files - 1)
(decodeUtf8 -> current) <- gsettings "get" "org.gnome.desktop.background" "picture-uri" |> captureTrim

View file

@ -26,7 +26,7 @@ in {
'';
activateMode = writeHaskellScript { name = "activate-mode"; } ''
getMode :: IO Text
getMode = decodeUtf8 <$> (cat "/home/maralorn/tmp/mode" |> captureTrim)
getMode = decodeUtf8 <$> (cat "/home/maralorn/volatile/mode" |> captureTrim)
main = do
mode <- getMode
@ -47,7 +47,7 @@ in {
selectMode = pkgs.writeShellScriptBin "select-mode" ''
${pkgs.dialog}/bin/dialog --menu "Select Mode" 20 80 5 ${
lib.concatStrings (map (mode: "${mode} '' ") modes)
} 2> ~/tmp/mode
} 2> ~/volatile/mode
clear
activate-mode > /dev/null
'';