diff options
Diffstat (limited to 'home/dot_local/share/bin/executable_panic')
| -rw-r--r-- | home/dot_local/share/bin/executable_panic | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/home/dot_local/share/bin/executable_panic b/home/dot_local/share/bin/executable_panic new file mode 100644 index 0000000..7455786 --- /dev/null +++ b/home/dot_local/share/bin/executable_panic @@ -0,0 +1,36 @@ +#!/bin/sh +silent() { + "$@" 1>/dev/null 2> /dev/null & +} + +on() { + # clear desktop + silent i3-msg focus output primary + silent i3-msg workspace 'panic1' + silent i3-msg focus output right + silent i3-msg workspace 'panic2' + + # stop playing media (if any) + silent mpc pause + silent playerctl -a pause + + # mute mic/headphones + silent pactl set-sink-mute @DEFAULT_SINK@ true + silent pactl set-source-mute @DEFAULT_SOURCE@ true +} + +off() { + # unmute mic/headphones + silent pactl set-sink-mute @DEFAULT_SINK@ false + silent pactl set-source-mute @DEFAULT_SOURCE@ false +} + +panicfile="$XDG_CACHE_HOME/panic" +if [ -e "$panicfile" ] ; then + rm "$panicfile" + off +else + touch "$panicfile" + on +fi + |