aboutsummaryrefslogtreecommitdiff
path: root/polybar/scripts/polybar/date.sh
blob: 698b15f5f6e5ae1250ca9c13986ab138fc456d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
t=0

draw() {
    if [ $t -eq 0 ]; then
        date +%H:%M
    else
        date +"%d %b %H:%M"
    fi
}

toggle() {
    t=$(((t + 1) % 2));
    draw
}


trap "toggle" USR1

while true; do
    draw
    sleep 60 &
    wait
done