-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2bspwm
executable file
·58 lines (47 loc) · 1.68 KB
/
2bspwm
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# neeasade
# makes dual borders
# depends on wmutils/opt
# polyfill a script in my dots.
bspwindows() {
case "${1:-active}" in
active)
bspc query -N -n .local.descendant_of.window.leaf.!fullscreen
;;
inactive)
bspc query -N -n .local.!descendant_of.window.leaf.!fullscreen
;;
esac
}
border_width_current=$(bspc config border_width)
# half if even, 1px to outer if odd
border_width_in_normal=$(( border_width_current ))
# border_width_out_normal=$(( border_width_current*5 ))
border_width_out_normal=20
border_width_in_focused=$border_width_in_normal
border_width_out_focused=$border_width_out_normal
background_color=$(getxres background | sed 's/#//g')
border_color_in_normal=$(getxres color8 | sed 's/#//g')
border_color_out_normal=$background_color
border_color_in_focused=$(getxres color1 | sed 's/#//g')
border_color_out_focused=$background_color
type theme >/dev/null 2>&1 && eval "$(theme get)"
_chwb2() {
colorType=$1
shift
_getVal() {
eval echo \$${1}_${colorType}
}
[ "$width_normal" = "$width_focused" ] || \
echo "$@" | sed 's/ /\n/g' | xargs -I{} bspc config -n {} border_width $(_getVal width)
chwb2 -I $(_getVal border_color_in) -O $(_getVal border_color_out) -i $(_getVal border_width_in) -o $(_getVal border_width_out) $@ 2>/dev/null
}
width_normal=$((border_width_in_normal+border_width_out_normal))
width_focused=$((border_width_in_focused+border_width_out_focused))
bspc config border_width "$width_normal"
_chwb2 focused $(bspwindows)
_chwb2 normal $(bspwindows inactive)
bspc subscribe node_state node_geometry node_focus | while read msg; do
_chwb2 focused $(bspwindows)
_chwb2 normal $(bspwindows inactive)
done