Wrote combined setup scripts for user and root

This commit is contained in:
2018-12-03 17:20:17 -05:00
parent 3e6d75221f
commit ae31b055c2
7 changed files with 116 additions and 8 deletions

View File

@@ -17,17 +17,20 @@
#------------------------------------------------------------------------
INTERFACE="${BLOCK_INSTANCE:-wlan0}"
echo $INTERFACE
# INTERFACE="${INSTANCE}"
#------------------------------------------------------------------------
# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless
# connection (think desktop), the corresponding block should not be displayed.
[[ ! -d /sys/class/net/${INTERFACE}/wireless ]] ||
[[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit
# [[ ! -d /sys/class/net/${INTERFACE}/wireless ]] ||
# [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit
#------------------------------------------------------------------------
QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
echo $QUALITY
W_inter=$(ip link | grep "[1-9]: wlp" | cut -d " " -f2 | tr -d ':')
W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}')

View File

@@ -41,7 +41,7 @@ color=#cccccc
# [wifi]
# label=
# instance=wlp3s0
# instance=wlp4s0
# interval=10
# unbold this?