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

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