summaryrefslogtreecommitdiffstats
path: root/.local/bin/my-bar
blob: 18f8a920232c87152f5ce8b4f8c61beeaa719165 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
while true
do
    b0="/sys/class/power_supply/BAT0"
    bat="$(cat $b0/capacity)"
    # batl="$(cat $b0/capacity_level)"
    pm="pamixer --get-volume"
    pmm="pamixer --get-mute"
    vol="$($pm)"
    [ "$($pmm)" = "true" ] && volm='-' || volm='+'
    volmic="$($pm --default-source)"
    [ "$($pmm --default-source)" = "true" ] && volmicm='-' || volmicm='+'
    load="$(cat /proc/loadavg | cut -d' ' -f1)"
    time="$(date +'%a, %-d %b %Y %R %z')"
	printf "%s%% | %s%s,%s%s | %s | %s\n" \
           "$bat" \
           "$vol" "$volm" "$volmic" "$volmicm" \
           "$load" "$time"
	sleep 5
done