my dotz
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 1.0 kB View raw
1#!/bin/sh 2 3while true 4do 5 wifi="disconnected (0%)" 6 if nmcli dev show wlp0s20f3 | grep GENERAL.STATE | grep -q connected; then 7 wifiname="$(nmcli -t dev show wlp0s20f3 | grep GENERAL.CONNECTION | cut -d ':' -f 2)" 8 # wifistrength="$(nmcli dev show wlp0s20f3 | awk '/GENERAL.STATE/ {print $2}')" 9 # wifi="$wifiname ($wifistrength%)" 10 wifi="$wifiname" 11 fi 12 vpn="disconnected" 13 if ip link ls gpd0 | grep -q UP; then 14 vpn="connected" 15 fi 16 battery="$(cat /sys/class/power_supply/BAT0/capacity)%" 17 # time=$(date +"%A %Y-%m-%d %I:%M %p") 18 ymd="$(date +"%Y-%m-%d")" 19 pst_time=$(TZ=America/Los_Angeles date +"%I:%MPT") 20 cst_time=$(TZ=America/Chicago date +"[%I:%MCT]") 21 est_time=$(TZ=America/New_York date +"%I:%MET") 22 utc_time=$(date -u +"%H:%MUTC") 23 time="$pst_time/$cst_time/$est_time/$utc_time" 24 # --date='TZ="America/New_York" 25 printf "wifi=%s vpn=%s bat=%s | %s %s\n" "$wifi" "$vpn" "$battery" "$time" "$ymd" 26 sleep 10 27done