From 4d98c61049d5dbf1cd2b75125d2b4606114d0576 Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Sun, 21 Feb 2021 08:48:17 -0500 Subject: [PATCH] Synth power menu --- scripts/audio/synth-power-prompt.sh | 15 +++++++++++++++ scripts/desktop/i3wm-close-window.py | 5 ++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 scripts/audio/synth-power-prompt.sh diff --git a/scripts/audio/synth-power-prompt.sh b/scripts/audio/synth-power-prompt.sh new file mode 100755 index 0000000..3fc4295 --- /dev/null +++ b/scripts/audio/synth-power-prompt.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +# Script to bring up a prompt to set synth power state. + +current='Keep current state' +off='Power synths off' +on='Power synths on' +selected=$(echo -e "${current}\n${off}\n${on}" | rofi -dmenu -p \ + 'Change synth power' -theme ~/.config/rofi/themes/aqua) + +if [ "$selected" == "$off" ]; then + python ~/.config/scripts/audio/synth-power.py -o +elif [ "$selected" == "$on" ]; then + python ~/.config/scripts/audio/synth-power.py -d +fi diff --git a/scripts/desktop/i3wm-close-window.py b/scripts/desktop/i3wm-close-window.py index 6c5a25a..eaa6ca1 100644 --- a/scripts/desktop/i3wm-close-window.py +++ b/scripts/desktop/i3wm-close-window.py @@ -4,10 +4,13 @@ import i3ipc, os def onWindowClose(conn, win): if(win.ipc_data['container']['window_properties']['class'] == 'Bitwig Studio'): - os.system('sh ~/dotfiles/scripts/audio/aquamix.sh -n') + os.system('sh ~/.config/scripts/audio/aquamix.sh -n') + os.system('sh ~/.config/scripts/audio/synth-power-prompt.sh') i3 = i3ipc.Connection() i3.on('window::close', onWindowClose) i3.main() + +