Do some refactoring and add bubble and delete function for desktops

This commit is contained in:
David Holland 2020-03-04 14:48:57 +01:00
parent b0b92e3ac2
commit 7b05189346
Signed by: DustVoice
GPG key ID: 47068995A14EDCA9
5 changed files with 66 additions and 48 deletions

View file

@ -0,0 +1,46 @@
#!/bin/sh
dmenu_string="Wrong parameter"
case $1 in
"rename")
dmenu_string="Rename desktop to: " ;;
"delete")
dmenu_string="Really delete this desktop? (n = abort): " ;;
"swap")
dmenu_string="Swap desktop with desktop: " ;;
"swapfollow")
dmenu_string="Swap and follow desktop with desktop: " ;;
esac
if [[ $1 == "delete" ]]; then
desktop=$(echo "" | dmenu -p "$dmenu_string")
else
if [[ $1 != "bubbleprev" && $1 != "bubblenext" ]]; then
desktop=$(bspc query -m focused -D --names | dmenu -p "$dmenu_string")
fi
fi
case $1 in
"rename")
if [[ $desktop != "" ]];
then
bspc desktop -n $desktop
fi
;;
"delete")
echo $desktop
if [[ $desktop != "n" ]];
then
bspc desktop -r
fi
;;
"swap")
bspc desktop -s $desktop ;;
"swapfollow")
bspc desktop -s $desktop --follow ;;
"bubbleprev")
bspc desktop -b prev ;;
"bubblenext")
bspc desktop -b next ;;
esac

View file

@ -1,34 +0,0 @@
#!/bin/sh
dmenu_string="Wrong parameter"
case $1 in
"rename")
dmenu_string="Rename desktop to: " ;;
"swap")
dmenu_string="Swap desktop with desktop: " ;;
"swapfollow")
dmenu_string="Swap and follow desktop with desktop: " ;;
esac
desktop=$(bspc query -m focused -D --names | dmenu -p "$dmenu_string")
case $1 in
"rename")
if [[ $desktop != "" ]];
then
bspc desktop -n $desktop
else
response=$(echo "" | dmenu -p 'Really remove this desktop? (n = abort): ')
if [[ $response != "n" ]];
then
bspc desktop -r
fi
fi
;;
"swap")
bspc desktop -s $desktop ;;
"swapfollow")
bspc desktop -s $desktop --follow ;;
esac

View file

@ -118,37 +118,43 @@ alt + d
dmenu_run dmenu_run
alt + x alt + x
$HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh goto $HOME/.config/dmenu/dmenu-bspwm-desktop-content.sh goto
alt + shift + x alt + shift + x
$HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh move $HOME/.config/dmenu/dmenu-bspwm-desktop-content.sh move
alt + ctrl + shift + x alt + ctrl + shift + x
$HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh movefollow $HOME/.config/dmenu/dmenu-bspwm-desktop-content.sh movefollow
alt + z alt + z; r
$HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh rename $HOME/.config/dmenu/dmenu-bspwm-desktop.sh rename
alt + shift + z alt + z; d
$HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh swap $HOME/.config/dmenu/dmenu-bspwm-desktop.sh delete
alt + ctrl + shift + z alt + z; s
$HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh swapfollow $HOME/.config/dmenu/dmenu-bspwm-desktop.sh swap
alt + z; h
$HOME/.config/dmenu/dmenu-bspwm-desktop.sh bubbleprev
alt + z; l
$HOME/.config/dmenu/dmenu-bspwm-desktop.sh bubblenext
alt + a; g alt + a; g
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh goto $HOME/.config/dmenu/dmenu-bspwm-monitor.sh goto
alt + a; s alt + a; s
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh swap $HOME/.config/dmenu/dmenu-bspwm-monitor.sh swap
alt + a; shift + n alt + a; shift + n
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movenode $HOME/.config/dmenu/dmenu-bspwm-monitor.sh movenode
alt + a; ctrl + shift + n alt + a; ctrl + shift + n
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movenodefollow $HOME/.config/dmenu/dmenu-bspwm-monitor.sh movenodefollow
alt + a; shift + d alt + a; shift + d
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movedesktop $HOME/.config/dmenu/dmenu-bspwm-monitor.sh movedesktop
alt + a; ctrl + shift + d alt + a; ctrl + shift + d
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movedesktopfollow $HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movedesktopfollow