public
Created

rulec / ruled replacement

  • Download Gist
~\.config\bspwm\rules
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#!/bin/bash
readarray -t PROPS < <(xwinfo -its $1)
 
INST=${PROPS[0]}
TYPE=${PROPS[1]}
STATE=(${PROPS[2]})
 
RULE=()
 
# Sane defaults
case "$TYPE" in
dock|desktop|notification) RULE+=("manage=off") ;;
toolbar|utility) RULE+=("focus=off") ;;
desktop) RULE+=("lower=on") ;;
esac
 
for s in $STATE; do
case $s in
sticky) RULE+=("sticky=on") ;;
fullscreen) RULE+=("fullscreen=on") ;;
esac
done
 
# Custom rules
case "$INST" in
mpv|skype|transmission)
RULE+=("floating=on") ;;
conky)
RULE+=("sticky=on manage=off") ;;
astime)
RULE+=("sticky=on") ;;
feh)
RULE+=("floating=on manage=off") ;;
BSPWM_FRAME|bspwm_frame)
RULE+=("frame=on") ;;
esac
 
echo "${RULE[*]}"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.