-
Notifications
You must be signed in to change notification settings - Fork 0
/
iq_rules
executable file
·43 lines (37 loc) · 1.05 KB
/
iq_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
39
40
41
42
43
#!/bin/bash
bspc rule -a Gimp desktop=^8 follow=on floating=on
bspc rule -a Chromium desktop=^2
# bspc rule -a mplayer2 floating=on
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off
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
vlc|transmission-gtk)
RULE+=("floating=on") ;;
BSPWM_FRAME|bspwm_frame)
RULE+=("frame=on") ;;
# From another section
# bspc rule -a Gimp desktop=^8 follow=on floating=on
# bspc rule -a Chromium desktop=^2
# # bspc rule -a mplayer2 floating=on
# bspc rule -a Kupfer.py focus=on
# bspc rule -a Screenkey manage=off
esac
echo "${RULE[*]}"