old-dotfiles/bin/windowpromoter

27 lines
736 B
Plaintext
Raw Normal View History

2023-04-18 09:55:20 +02:00
#!/usr/bin/sh
receptacle=$(bspc query -N -n ".leaf.!window.local" | awk NR==1)
window_promotion()
{
if [ -n "$receptacle" ] > /dev/null ; then
bspc node -n "$receptacle"
elif [ -z "$(bspc query -N -n last.!automatic.local)" ]; then \
bspc node -s biggest.!focused.local; \
else \
bspc node -n last.!automatic.local; \
fi
}
if bspc query -N -n "@/.!automatic" > /dev/null ; then
bspc node -n @/ || window_promotion
else
if [ -n "$receptacle" ] > /dev/null ; then
bspc node -n "$receptacle"
elif [ -z "$(bspc query -N -n last.!automatic.local)" ]; then \
bspc node -s biggest.!focused.local; \
else \
bspc node -n last.!automatic.local; \
fi
fi