From 6010a0c2d1b8470ad2c25dd4ba46d258e0f19859 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 4 Apr 2017 19:45:18 -0700 Subject: [PATCH] [Linux] Unmute all when no action selected in rofi_select_input.hs --- dotfiles/lib/bin/rofi_select_input.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dotfiles/lib/bin/rofi_select_input.hs b/dotfiles/lib/bin/rofi_select_input.hs index f95915a7..22dc9605 100755 --- a/dotfiles/lib/bin/rofi_select_input.hs +++ b/dotfiles/lib/bin/rofi_select_input.hs @@ -23,6 +23,7 @@ main = do unMuteSelected = setMuteAction "0" selectedSink selectedIsMuted = fromMaybe True $ isMuted . (!! 1) <$> find ((== selectedSink) . head) matches + setAll state = mapM_ (setMuteAction state . head) matches print selectedSink print matches print selectedIsMuted @@ -31,9 +32,9 @@ main = do void $ setMuteAction (toSetString selectedIsMuted) selectedSink ExitFailure 10 -> do - mapM_ (setMuteAction "1" . head) matches + setAll "1" void unMuteSelected - ExitFailure _ -> return () + ExitFailure _ -> setAll "0" where getSinkText = do (_, txt, _) <- readCreateProcessWithExitCode (shell "pactl list sink-inputs") "" return txt