Update mode location
This commit is contained in:
parent
bc341930bd
commit
47cec2c8a7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue