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="off"
    if ip link ls gpd0 | grep -q UP; then
      vpn="on"
    fi
    battery="$(cat /sys/class/power_supply/BAT0/capacity)%"
    # time=$(date +"%A %Y-%m-%d %I:%M %p")
    pst_time=$(TZ=America/Los_Angeles date +"%I:%M PT ")
    cst_time=$(TZ=America/Chicago date +"[%I:%M CT] ")
    est_time=$(TZ=America/New_York date +"%I:%M ET ")
    utc_time=$(date -u +"%H:%M UTC ")
    time="$pst_time $cst_time $est_time $utc_time"
    # --date='TZ="America/New_York"
    printf "%s | %s | %s\n" "wifi: ${wifi} vpn: $vpn" "bat: ${battery}" "${time}"
    sleep 10
done