diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
| commit | e43eb1177872f52e949fb5f0f93396ed94b0d093 (patch) | |
| tree | 78b73af6a989fa2996d71b112e161b70d35081ef /home/dot_local/share/bin/executable_panic | |
| parent | 2f14a896e4b897bd747c24d7ad8e9e7bb3237d03 (diff) | |
move to chezmoi
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 + |