-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2bspwmnew
More file actions
58 lines (46 loc) · 1.62 KB
/
2bspwmnew
File metadata and controls
58 lines (46 loc) · 1.62 KB
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
#!/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*8 ))
border_width_in_focused=$border_width_in_normal
border_width_out_focused=$border_width_out_normal
background_color=$(xrdb -query | grep background | cut -d':' -f2 | sed 's/ //g' | sed 's/#//g')
border_color_in_normal=ff00ff
border_color_out_normal=ffffff
border_color_in_focused=368dff
border_color_out_focused=ffffff
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