56 lines
1.4 KiB
Bash
Executable file
56 lines
1.4 KiB
Bash
Executable file
#!/usr/bin/env zsh
|
|
|
|
if [[ -f $HOME/.zsh_alias ]]; then
|
|
source $HOME/.zsh_alias
|
|
fi
|
|
|
|
local 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
|
|
|
|
local desktop=""
|
|
|
|
if [[ $1 == "delete" || $1 == "rename" ]]; then
|
|
desktop=$(echo "" | dmenu -i -fn $(get-font) -nb "#282a36" -nf "#f8f8f2" -sb "#44475a" -sf "#f8f8f2" -p "$dmenu_string")
|
|
else
|
|
if [[ $1 != "bubbleprev" && $1 != "bubblenext" && $1 != "save" && $1 != "load" ]]; then
|
|
desktop=$(bspc query -m focused -D --names | dmenu -i -fn $(get-font) -nb "#282a36" -nf "#f8f8f2" -sb "#44475a" -sf "#f8f8f2" -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 ;;
|
|
"save")
|
|
bspwm-save ;;
|
|
"load")
|
|
bspwm-load ;;
|
|
esac
|