dotfiles/.config/dmenu/dmenu-bspwm-desktop-content.sh
2020-03-28 21:18:33 +01:00

40 lines
871 B
Bash
Executable file

#!/bin/sh
dmenu_string="Wrong parameter"
case $1 in
"goto")
dmenu_string="Switch to desktop: " ;;
"move")
dmenu_string="Move node to desktop: " ;;
"movefollow")
dmenu_string="Move and follow node to desktop: " ;;
esac
desktop=$(bspc query -m focused -D --names | dmenu -i -fn Hack -nb "#282a36" -nf "#f8f8f2" -sb "#44475a" -sf "#f8f8f2" -p "$dmenu_string")
found=false
desktop_list=$(bspc query -m focused -D --names | tr '\n' ' ')
if [[ $desktop != "" ]];
then
for name in $desktop_list; do
if [[ $name == $desktop ]]; then
found=true
fi
done
fi
if [ ! $found = true ]; then
bspc monitor -d $desktop_list $desktop
fi
case $1 in
"goto")
bspc desktop -f $desktop ;;
"move")
bspc node -d $desktop ;;
"movefollow")
bspc node -d $desktop --follow ;;
esac