21 lines
636 B
Bash
Executable File
21 lines
636 B
Bash
Executable File
#!/usr/bin/env dash
|
|
# todo: handle interop between floating and tiled better
|
|
|
|
# Shamelessly stolen from https://github.com/neeasade/dotfiles/tree/master/wm/.wm/scripts/interact
|
|
|
|
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
|