Skip to content

Instantly share code, notes, and snippets.

@Vftdan
Last active March 1, 2020 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vftdan/12cf4776c838b69fe529ecdb3cc0a3be to your computer and use it in GitHub Desktop.
Save Vftdan/12cf4776c838b69fe529ecdb3cc0a3be to your computer and use it in GitHub Desktop.
Minimize windows while using bspwm
#! /bin/sh
xev -root | grep '(_NET_ACTIVE_WINDOW)' -B 1 --line-buffered | \
grep '^ClientMessage' --line-buffered | sed -u -e 's/^.*window //; s/,//' | \
while read w; do \
if [ -n "$(bspc query -N -n $w.hidden)" ]; then \
bspc node "$w" -g hidden=off
bspc node $w.fullscreen -t tiled
bspc node $w -l normal
bspc node -a $w
fi
done
super + F6
w=$(bspc query -N -n focused.local.!below); \
if [ -n "$w" ]; then \
bspc node $w.tiled -t fullscreen; \
bspc node $w -l below; \
bspc node $w -g hidden=on; \
fi
super + {_,ctrl + }shift + F6
w=$(bspc query -N -n .hidden.local.below | while read i; \
do echo $i $(xprop -id $i | fgrep NET_WM_NAME | \
sed 's/^[^=]* = //'); done | {head -n 1,rofi -dmenu}); \
if [ -n "$w" ]; then \
w=$(echo $w | cut -d ' ' -s -f 1); \
bspc node "$w" -g hidden=off; \
bspc node $w.fullscreen -t tiled; \
bspc node $w -l normal; \
bspc node -f $w; \
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment