aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/menudisplay
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin/menudisplay')
-rwxr-xr-xdotfiles/.local/bin/menudisplay14
1 files changed, 14 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/menudisplay b/dotfiles/.local/bin/menudisplay
new file mode 100755
index 0000000..6064bff
--- /dev/null
+++ b/dotfiles/.local/bin/menudisplay
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Source settings from .bemenurc
+. $HOME/.bemenurc
+
+display=$(swaymsg -t get_outputs | grep -E "name" | sed "s/^.*\"name\": \"//g;s/\",$//g;" | bemenu -p "Select output: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")
+
+if [ -z $display ]; then
+ exit 0
+fi
+
+action=$(printf "enable\ndisable\n" | bemenu -p "Choose action: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")
+
+swaymsg output $display $action