1
0
forked from extern/nix-config

bspwm: Don't open new nodes on empty desktops

I initially programmed this "dynamic desktops" implementation for a
similar feel to GNOME, however after using it for a few months I
realized that I was taking away one of the main advantages of a tiling
window manager by having all windows not tile by default.

Additionally, I ran into some edge cases where the next window would not
show if opened on a desktop that had multiple nodes open. Although I
could probably figure out the cause with some effort, I'd much rather
enjoy the simplicity of the traditional tiling hierarchy once more.
This commit is contained in:
Donovan Glover 2023-03-25 07:21:16 -04:00
parent 9089c7a2c1
commit 10c79f72d0
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -141,17 +141,6 @@ alttab -d 1 -w 1 -font "xft:Noto Sans CJK JP" -mk Super_L -kk grave &
# Fix bar showing above fullscreen programs # Fix bar showing above fullscreen programs
xdo above -t "$(xdo id -N Bspwm -n root | sort | head -n 1)" $(xdo id -n tint2) xdo above -t "$(xdo id -N Bspwm -n root | sort | head -n 1)" $(xdo id -n tint2)
# Open new nodes on the next unoccupied desktop (dynamic desktops part 1)
bspc subscribe node_add | while read event; do
if [ $(bspc query -N -n '.local.!hidden.tiled' | wc -l) -gt 1 ]; then
nodeId=$(echo "$event" | cut -d" " -f 5)
next=$(bspc query -D -d 'next.!occupied')
if [ -n "$next" ]; then
bspc node "$nodeId" --to-desktop "$next" --follow
fi
fi
done &
# Go to the previous node if the current desktop is empty (dynamic desktops part 2) # Go to the previous node if the current desktop is empty (dynamic desktops part 2)
bspc subscribe node_remove | while read event; do bspc subscribe node_remove | while read event; do