From ec91620004d6b24024fec856192683184d3e5b3a Mon Sep 17 00:00:00 2001 From: awy Date: Mon, 27 Jan 2025 17:25:54 +0300 Subject: update --- .local/bin/statusbar/sb-internet | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to '.local/bin/statusbar/sb-internet') diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 0e21c3b..4afa856 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -1,43 +1,43 @@ #!/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 togglevpn() { - if [ ! -n "$(cat /sys/class/net/wg0/operstate 2>/dev/null)" ];then - doas wg-quick up wg0 - notify-send "๐Ÿ”’ Internet module" "Connected to VPN" - else - doas wg-quick down wg0 - notify-send "๐Ÿ”’ Internet module" "Disconnected from VPN" - fi + if [ ! -n "$(cat /sys/class/net/libre/operstate 2>/dev/null)" ];then + reloadsingbox + notify-send " ๏€ฃ Internet module" "Connected to VPN" + else + killall sing-box + notify-send " ๏ Internet module" "Disconnected from VPN" + fi } case $1 in 1) togglevpn 2>/dev/null ;; - 3) notify-send "๐ŸŒ Internet module" "\- Click to enable/disable VPN -โŒ: wifi disabled -๐Ÿ“ก: no wifi connection -๐Ÿ“ถ: wifi connection with quality -โŽ: no ethernet -๐ŸŒ: ethernet working -๐Ÿ”’: vpn is active -" ;; - 6) hyprctl dispatch exec "$TERMINAL -e \"$EDITOR\" \"$0\"" ;; + 3) notify-send "๏‚ฌ Internet module" "\- Click to enable/disable VPN +๏€ : wifi disabled +๓ฐคฎ : no wifi connection +๓ฐคจ : wifi connection with quality +๓ฑ˜– : no ethernet +๏›ฟ : ethernet working +๏€ฃ : vpn is active + " ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac # Wifi if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; 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)" elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then - [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="๐Ÿ“ก " || wifiicon="โŒ " + [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="๓ฐคฎ " || wifiicon="๏€ " fi # Ethernet -[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="๐ŸŒ" || ethericon="โŽ" +[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="๏›ฟ " || ethericon="๓ฑ˜– " -# Wireguard -[ -n "$(cat /sys/class/net/wg*/operstate 2>/dev/null)" ] && tunicon=" ๐Ÿ”’" +# VPN (change libre to your tun interface name) +[ -n "$(cat /sys/class/net/libre/operstate 2>/dev/null)" ] && tunicon=" ๏€ฃ " printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon" -- cgit v1.2.3