blob: 4fb1b1c9810f9e5997567c58abc8244296f9d4ed (
plain)
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
|
#!/bin/sh
gib_workspace_names() {
wmctrl -d \
| awk '{ print $1 " " $2 " " $9 }' \
| grep -v NSP
}
gib_workspace_yuck() {
buffered=""
gib_workspace_names | while read -r id active name; do
name="${name#*_}"
if [ "$active" == '*' ]; then
active_class="active"
else
active_class="inactive"
fi
if wmctrl -l | grep --regexp '.*\s\+'"$id"'\s\+.*' >/dev/null; then
button_class="occupied"
button_name="●"
else
button_class="empty"
button_name="○"
fi
buffered+="(button :class \"$button_class $active_class\" :onclick \"wmctrl -s $id\" \"$button_name\")"
echo -n "$buffered"
buffered=""
done
}
box_attrs=':orientation "h" :class "workspaces" :space-evenly false :halign "center" :valign "center" :vexpand false :spacing 8 '
echo "(box $box_attrs $(gib_workspace_yuck))"
|