From e43eb1177872f52e949fb5f0f93396ed94b0d093 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 2 Aug 2026 14:48:29 +0200 Subject: move to chezmoi --- home/dot_local/share/bin/executable_panic | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 home/dot_local/share/bin/executable_panic (limited to 'home/dot_local/share/bin/executable_panic') 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 + -- cgit v1.2.3