dgy
/
hexagons
Archived
1
0
Fork 0
This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
hexagons/.local/bin/foco

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