all repos — dotfiles @ old

my *nix dotfiles

bin/bar (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
#!/bin/sh

dt() {
    date +"%a, %d %b" | tr A-Z a-z
}

vol() {
    v="$(sndioctl -n output.level)"
    echo $(echo "$v"*100 / 1 | bc)%
}

pad="%{015}"

while :; do
    bat="$(bat -q)"
    time="$(date +"%H:%M")"
    echo "$pad $(dt) $pad $time %{r}bat $bat %{O14}vol $(vol) $pad"
    sleep 0.5
done | lemonbar-xft -n bar -f 'Input:style=Regular:size=12:antialias=true' -g x30 \
    -F '#f4f4f4' -B '#222'