From 7b051893468b5ef788cdd101e97528d134484a72 Mon Sep 17 00:00:00 2001 From: DustVoice Date: Wed, 4 Mar 2020 14:48:57 +0100 Subject: [PATCH] Do some refactoring and add bubble and delete function for desktops --- ...ktop.sh => dmenu-bspwm-desktop-content.sh} | 0 .config/dmenu/dmenu-bspwm-desktop.sh | 46 +++++++++++++++++++ ...ment-monitor.sh => dmenu-bspwm-monitor.sh} | 0 .config/dmenu/dmenu-bspwm-rename-desktop.sh | 34 -------------- .config/sxhkd/sxhkdrc | 34 ++++++++------ 5 files changed, 66 insertions(+), 48 deletions(-) rename .config/dmenu/{dmenu-bspwm-movement-desktop.sh => dmenu-bspwm-desktop-content.sh} (100%) create mode 100755 .config/dmenu/dmenu-bspwm-desktop.sh rename .config/dmenu/{dmenu-bspwm-movement-monitor.sh => dmenu-bspwm-monitor.sh} (100%) delete mode 100755 .config/dmenu/dmenu-bspwm-rename-desktop.sh diff --git a/.config/dmenu/dmenu-bspwm-movement-desktop.sh b/.config/dmenu/dmenu-bspwm-desktop-content.sh similarity index 100% rename from .config/dmenu/dmenu-bspwm-movement-desktop.sh rename to .config/dmenu/dmenu-bspwm-desktop-content.sh diff --git a/.config/dmenu/dmenu-bspwm-desktop.sh b/.config/dmenu/dmenu-bspwm-desktop.sh new file mode 100755 index 0000000..2fdbdaf --- /dev/null +++ b/.config/dmenu/dmenu-bspwm-desktop.sh @@ -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 diff --git a/.config/dmenu/dmenu-bspwm-movement-monitor.sh b/.config/dmenu/dmenu-bspwm-monitor.sh similarity index 100% rename from .config/dmenu/dmenu-bspwm-movement-monitor.sh rename to .config/dmenu/dmenu-bspwm-monitor.sh diff --git a/.config/dmenu/dmenu-bspwm-rename-desktop.sh b/.config/dmenu/dmenu-bspwm-rename-desktop.sh deleted file mode 100755 index da2c2bc..0000000 --- a/.config/dmenu/dmenu-bspwm-rename-desktop.sh +++ /dev/null @@ -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 diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 5a854ee..8aa47b9 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -118,37 +118,43 @@ alt + d dmenu_run alt + x - $HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh goto + $HOME/.config/dmenu/dmenu-bspwm-desktop-content.sh goto 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 - $HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh movefollow + $HOME/.config/dmenu/dmenu-bspwm-desktop-content.sh movefollow -alt + z - $HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh rename +alt + z; r + $HOME/.config/dmenu/dmenu-bspwm-desktop.sh rename -alt + shift + z - $HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh swap +alt + z; d + $HOME/.config/dmenu/dmenu-bspwm-desktop.sh delete -alt + ctrl + shift + z - $HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh swapfollow +alt + z; s + $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 - $HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh goto + $HOME/.config/dmenu/dmenu-bspwm-monitor.sh goto alt + a; s - $HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh swap + $HOME/.config/dmenu/dmenu-bspwm-monitor.sh swap 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 - $HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movenodefollow + $HOME/.config/dmenu/dmenu-bspwm-monitor.sh movenodefollow 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 $HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movedesktopfollow