Last active
June 17, 2022 22:30
-
-
Save sumeet/30242cef3efcb1979c8b993e16bf8df0 to your computer and use it in GitHub Desktop.
script i grabbed from https://www.reddit.com/r/bspwm/comments/970ece/chunkwmlike_window_warping/
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
#!/usr/bin/sh | |
# which window to be warped to | |
dir=$1 | |
fwid=$(bspc query -N -n $dir) | |
if [ -n "$fwid" ] ; then | |
wattr wh $fwid | { | |
read width height | |
# decide the split direction before warping to a new container | |
# | |
# to your preference, you can try reversing these, and you can | |
# always `bspc node @parent -R 90` to adjust the rotation manually | |
if [ $width -gt $height ] ; then | |
split_dir=south | |
else | |
split_dir=west | |
fi | |
# mark focused node | |
bspc node -g marked | |
# correctly split the "to be warped to" window | |
bspc node $dir -p $split_dir | |
# warp | |
bspc node newest.marked.local -n newest.!automatic.local | |
} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment