forked from colonelpanic/dotfiles
[Linux] Unmute all when no action selected in rofi_select_input.hs
This commit is contained in:
parent
fb3e63377f
commit
6010a0c2d1
@ -23,6 +23,7 @@ main = do
|
|||||||
unMuteSelected = setMuteAction "0" selectedSink
|
unMuteSelected = setMuteAction "0" selectedSink
|
||||||
selectedIsMuted = fromMaybe True $
|
selectedIsMuted = fromMaybe True $
|
||||||
isMuted . (!! 1) <$> find ((== selectedSink) . head) matches
|
isMuted . (!! 1) <$> find ((== selectedSink) . head) matches
|
||||||
|
setAll state = mapM_ (setMuteAction state . head) matches
|
||||||
print selectedSink
|
print selectedSink
|
||||||
print matches
|
print matches
|
||||||
print selectedIsMuted
|
print selectedIsMuted
|
||||||
@ -31,9 +32,9 @@ main = do
|
|||||||
void $ setMuteAction (toSetString selectedIsMuted) selectedSink
|
void $ setMuteAction (toSetString selectedIsMuted) selectedSink
|
||||||
ExitFailure 10 ->
|
ExitFailure 10 ->
|
||||||
do
|
do
|
||||||
mapM_ (setMuteAction "1" . head) matches
|
setAll "1"
|
||||||
void unMuteSelected
|
void unMuteSelected
|
||||||
ExitFailure _ -> return ()
|
ExitFailure _ -> setAll "0"
|
||||||
where getSinkText = do
|
where getSinkText = do
|
||||||
(_, txt, _) <- readCreateProcessWithExitCode (shell "pactl list sink-inputs") ""
|
(_, txt, _) <- readCreateProcessWithExitCode (shell "pactl list sink-inputs") ""
|
||||||
return txt
|
return txt
|
||||||
|
Loading…
Reference in New Issue
Block a user