blob: 1069b6752efe2581c6c56563c2f3e2e4d6b57644 (
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
35
36
37
38
39
|
#!/bin/dash
# echo 0; exit 0
# loads colors
. ~/.cache/wal/colors.sh
SEPARATOR=" "
# default color button
use() {
printf "%s^c%s^^b%s^ %s ^b%s^ %s ^b%s^" "$SEPARATOR" "$background" "$primary" "$1" "$accent" "$2" "$background"
}
# show in specified color if specified condition is true
usecolorif() {
if [ "$3" = "1" ]; then
printf "%s^c%s^^b%s^ %s ^c%s^^b%s^ %s ^b%s^" "$SEPARATOR" "$primary" "$background" "$1" "$accent" "$background" "$2" "$background"
else
use "$1" "$2"
fi
}
# only show if content is not zero
useif() {
if [ -n "$2" ]; then
use "$1" "$2"
fi
}
# actual string
echo "\
$(useif "" "$(updates read)")\
$(useif "" "$(mute shortstatus)")\
$(useif "" "$(volume)")\
$(useif "" "$(network)")\
$(use "" "$(battery)")\
$(use "" "$(datetime)")\
"
|