Wrote combined setup scripts for user and root
This commit is contained in:
@@ -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}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user