From 07fc2644a237187dd4c5680e88f4adadbf533603 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Wed, 12 Aug 2015 12:06:23 -0600 Subject: Initial commit of the working files --- lib/muting.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/muting.sh (limited to 'lib/muting.sh') diff --git a/lib/muting.sh b/lib/muting.sh new file mode 100644 index 0000000..595ba87 --- /dev/null +++ b/lib/muting.sh @@ -0,0 +1,20 @@ +# Muting Logic +# In all cases $1 is the side to be muted (eg left/right). + +powerline_muted() { + [ -e "$(__powerline_mute_file $1)" ]; +} + +toggle_powerline_mute_status() { + if powerline_muted $1; then + rm "$(__powerline_mute_file $1)" + else + touch "$(__powerline_mute_file $1)" + fi +} + +__powerline_mute_file() { + local tmux_session=$(tmux display -p "#S") + + echo -n "${TMUX_POWERLINE_DIR_TEMPORARY}/mute_${tmux_session}_$1" +} -- cgit v1.2.3