diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-10-04 08:28:12 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-10-04 08:28:12 +0530 |
commit | f55a0a473c164dddb535aac34018e4d835016ffa (patch) | |
tree | bf4cc8aae4cc4d5d20bfaaf1957341438ac64f16 /.scripts/internet | |
parent | 38f4144eb1b8bbac7756ac38ce9d0b3b079c886f (diff) |
minimizing clock and internet script + adding fonticons
Diffstat (limited to '.scripts/internet')
-rwxr-xr-x | .scripts/internet | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/.scripts/internet b/.scripts/internet index 94b7da2..5b31ff3 100755 --- a/.scripts/internet +++ b/.scripts/internet @@ -1,26 +1,22 @@ #!/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 +# Show wifi and percent strength or 睊 if none. +# Show if connected to ethernet or if none. +# Show if a vpn connection is active -case $BLOCK_BUTTON in - 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; - 3) notify-send "🌐 Internet module" "\- Click to connect -❌: wifi disabled -📡: no wifi connection -📶: wifi connection with quality -❎: no ethernet -🌐: ethernet working -🔒: vpn is active -" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac +##轢: wifi disabled +##睊: no wifi connection +## : wifi connection with quality +## : no ethernet +## : ethernet working +## : vpn is active if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then - wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" + #wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)" + wifiicon=" " elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then - grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ " + grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="睊 " || wifiicon="轢 " fi -printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)" +#printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/ /;s/up/ /" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/ /" /sys/class/net/tun*/operstate 2>/dev/null)" +printf "%s%s\n" "$wifiicon" "$(sed "s/.*/ /" /sys/class/net/tun*/operstate 2>/dev/null)" |