Fixed wifi block, wrote own CPU usage script

Closes #40. Also added file listing USB OS's and made change-sink handle
both DAC names.
This commit is contained in:
2018-12-10 02:05:58 -05:00
parent 0248ff9b6e
commit 5c8764c056
13 changed files with 142 additions and 100 deletions

View File

@@ -17,8 +17,6 @@
#------------------------------------------------------------------------
INTERFACE="${BLOCK_INSTANCE:-wlan0}"
echo $INTERFACE
# INTERFACE="${INSTANCE}"
#------------------------------------------------------------------------
@@ -29,23 +27,24 @@ echo $INTERFACE
#------------------------------------------------------------------------
QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
echo $QUALITY
QUALITY=$(sudo grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
W_inter=$(ip link | grep "[1-9]: wlp" | cut -d " " -f2 | tr -d ':')
W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}')
#------------------------------------------------------------------------
# echo $QUALITY% "$W_name" # full text
echo $QUALITY% # short text
# echo $QUALITY% # short text
. "/home/kevin/.cache/wal/colors.sh"
printf "%s%%\n\n%s\n" $QUALITY $color7
# color
if [[ $QUALITY -ge 80 ]]; then
echo "#00FF00"
elif [[ $QUALITY -lt 80 ]]; then
echo "#FFF600"
elif [[ $QUALITY -lt 60 ]]; then
echo "#FFAE00"
elif [[ $QUALITY -lt 40 ]]; then
echo "#FF0000"
fi
# if [[ $QUALITY -ge 80 ]]; then
# echo "#00FF00"
# elif [[ $QUALITY -lt 80 ]]; then
# echo "#FFF600"
# elif [[ $QUALITY -lt 60 ]]; then
# echo "#FFAE00"
# elif [[ $QUALITY -lt 40 ]]; then
# echo "#FF0000"
# fi