-
-
Save ortango/29f8f4f4d6465c522e82ac60e64bb35d to your computer and use it in GitHub Desktop.
move node like "bubble"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ "$1" == '-r' ]] && rotate=yes && shift | |
[[ -n "$1" ]] || exit 1 | |
declare -A \ | |
toggledir=([north]=south [south]=north [east]=west [west]=east) \ | |
splitdir=([north]=horizontal [south]=horizontal [east]=vertical [west]=vertical) | |
dest=$(bspc query -N -n "${1}.window.local") | |
if bro="$(bspc query -N -n @brother)" && [[ "$rotate" ]]; then | |
bspc query -N -n "@parent.${splitdir[$1]}" &>/dev/null || | |
dest="$bro" | |
fi | |
[[ -n "$dest" ]] || exit | |
[[ "$dest" != "$bro" ]] && | |
set -- ${toggledir[$1]} | |
bspc node "$dest" -p "$1" && | |
bspc node -n "$dest" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment