aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.scripts/menudisplay
blob: 6064bff4d0d34e4aef40d913dca94a0c5814cfbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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