Port a few more options to zenity and separate dwm from the install script
This commit is contained in:
17
config-files/.local/bin/sb-network
Executable file
17
config-files/.local/bin/sb-network
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Show wifi 📶 and percent strength or 📡 if none.
|
||||
# Show 🌐 if connected to ethernet or ❎ if none.
|
||||
# Show 🔒 if a vpn connection is active
|
||||
|
||||
# Wifi
|
||||
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
|
||||
wifiicon="$(awk '/^[[:space:]]*w/ { gsub(/[[:space:]]+/, " "); print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
|
||||
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
|
||||
wifiicon=" "
|
||||
fi
|
||||
|
||||
# Ethernet
|
||||
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon=" " || ethericon=" "
|
||||
|
||||
printf "%s%s\n" "$wifiicon" "$ethericon"
|
||||
Reference in New Issue
Block a user