small pixel drawing of a pufferfish dotfiles

bin/zora/statusbar

#!/bin/sh

while true
do
    wifi="disconnected (0%)"
    if nmcli dev show wlp0s20f3 | grep GENERAL.STATE | grep -q connected; then
        wifiname="$(nmcli -t dev show wlp0s20f3 | grep GENERAL.CONNECTION | cut -d ':' -f 2)"
        # wifistrength="$(nmcli dev show wlp0s20f3 | awk '/GENERAL.STATE/ {print $2}')"
        # wifi="$wifiname ($wifistrength%)"
        wifi="$wifiname"
    fi
    vpn="disconnected"
    if ip link ls gpd0 | grep -q UP; then
      vpn="connected"
    fi
    battery="$(cat /sys/class/power_supply/BAT0/capacity)%"
    # time=$(date +"%A %Y-%m-%d %I:%M %p")
    ymd="$(date +"%Y-%m-%d")"
    pst_time=$(TZ=America/Los_Angeles date +"%I:%MPT")
    cst_time=$(TZ=America/Chicago date +"[%I:%MCT]")
    est_time=$(TZ=America/New_York date +"%I:%MET")
    utc_time=$(date -u +"%H:%MUTC")
    time="$pst_time/$cst_time/$est_time/$utc_time"
    # --date='TZ="America/New_York"
    printf "wifi=%s vpn=%s bat=%s | %s %s\n" "$wifi" "$vpn" "$battery" "$time" "$ymd"
    sleep 10
done