my-scripts/status-update

22 lines
627 B
Plaintext
Raw Permalink Normal View History

#!/bin/bash
2021-08-31 06:25:02 +00:00
for ifname in $(ls /sys/class/net/ | grep -v 'lo')
do
if ! [ -f "/sys/class/net/$ifname/operstate" ]
then
>&2 echo "$ifname has no operstate"
continue
fi
IF_STATUS=$(cat /sys/class/net/$ifname/operstate)
IF_STATE_LIST+=("$ifname: $IF_STATUS")
done
2021-08-31 06:25:02 +00:00
DATE="$(date +"%F %H:%M" )"
NETWORK="${IF_STATE_LIST[*]}"
2021-08-31 06:25:02 +00:00
SPACE="$(cat $HOME/.cache/free-space)"
vol_status="$(cat $HOME/.cache/audio-control/vol_status)"
vol_level="$(cat $HOME/.cache/audio-control/vol_level)%"
VOLUME="$vol_status $vol_level"
2022-05-31 20:03:27 +00:00
UPDATES="Upd: $(cat $HOME/.cache/update_count)"
2022-05-30 11:31:35 +00:00
xsetroot -name "$VOLUME | $NETWORK | $SPACE | $UPDATES | $DATE"