18 lines
475 B
Bash
Executable File
18 lines
475 B
Bash
Executable File
#!/bin/sh
|
|
|
|
dir=$1
|
|
|
|
if bspc query -N -n .focused.local.fullscreen; then
|
|
bspc monitor -f "$dir"
|
|
exit
|
|
fi
|
|
|
|
if ! bspc node -f "$dir".local; then
|
|
bspc query -T -d | jq .layout
|
|
if ! bspc monitor -f "$dir" && [ "$(bspc query -T -d | jq -r .layout)" = "monocle" ]; then
|
|
# assume we went up or down and failed and monocle, shuffle through style
|
|
[ "$dir" = "north" ] && bspc node -f next.local
|
|
[ "$dir" = "south" ] && bspc node -f prev.local
|
|
fi
|
|
fi
|