diff --git a/os/arch/bin/bspc.sh b/os/arch/bin/bspc.sh index fc753626..9933d118 100755 --- a/os/arch/bin/bspc.sh +++ b/os/arch/bin/bspc.sh @@ -2,10 +2,10 @@ set -e # A helper script for bspwm; makes the act of switching and swapping nodes act more -# intuitive. +# intuitive. Also hides lemonbar on fullscreening. -if (( $# < 2 )); then - >&2 echo "Usage: $0 [fFsS] DIRECTION" +if (( $# == 0 )); then + >&2 echo "Usage: $0 [f DIR|F DIR|s DIR|S DIR|m]" exit 1 fi @@ -13,6 +13,14 @@ cmd=$1 dir=$2 case $cmd in + m) main=$(bspc query -M -m primary) + mon=$(bspc query -M -m focused) + if [[ $main == $mon ]]; then + xdotool search --onlyvisible --classname lemonbar windowunmap || \ + xdotool search --classname lemonbar windowmap + fi + bspc desktop -l next + ;; # focus f) if ! bspc node -f "$dir.local"; then if [[ $(bspc query -M -m "$dir") ]]; then