small pixel drawing of a pufferfish dotfiles

bin/soba/statusbar

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

while true
do
    wifi="disconnected (0%)"
    if nmcli dev show wlan0 | grep GENERAL.STATE | grep -q connected; then
        wifiname="$(nmcli dev show wlan0 | grep 'GENERAL.CONNECTION' | sed 's|GENERAL.CONNECTION:[ ]*||g')"
        wifistrength="$(nmcli dev show wlan0 | awk '/GENERAL.STATE/ {print $2}')"
        wifi="$wifiname ($wifistrength%)"
    fi
    battery="$(cat /sys/class/power_supply/BAT1/capacity)%"
    time=$(date +"%A %Y-%m-%d %I:%M %p")
    time="$time $(date -u +"(🤖%H:%M UTC)")"
    printf "%s | %s | %s\n" "💓 ${wifi}" "🥤 ${battery}" "${time}"
    sleep 10
done