updating icons, status-net is borked for wifi :(

This commit is contained in:
Solomon Laing 2025-11-27 08:57:58 +10:30
parent cd3b6a94e5
commit 5443ed150a
5 changed files with 28 additions and 21 deletions

View File

@ -13,7 +13,7 @@ numlockx
nextcloud --background &
nitrogen --restore
"$HOME/.fehbg"
# set default desktop window layout
"$HOME/.screenlayout/default.sh"

View File

@ -9,5 +9,5 @@ case $BUTTON in
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
free --mebi | sed -n '2{p;q}' | awk '{printf (" %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'
free --mebi | sed -n '2{p;q}' | awk '{printf (" %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'

View File

@ -6,23 +6,30 @@
case $BUTTON in
1) "$TERMINAL" -e nmtui; pkill -RTMIN+15 dwmblocks ;;
3) notify-send "Internet module" "Shows network status
- Click to connect
❌: wifi disabled
3) notify-send "Internet module" "- Click to connect
󰯡 : wifi disabled
󰖪 : no wifi connection
 : wifi connection with quality
: no ethernet
: ethernet working
🔒: vpn is active
󰅛 : no ethernet
󰱓 : ethernet working
: vpn is active
" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
ssid="$(iw dev $(cat /proc/net/wireless | grep '^.*:' | sed 's/:.*//') link | grep -i SSID)"
wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "%" }' /proc/net/wireless) ${ssid##*SSID: } "
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="󰖪 " || wifiicon="❌ "
# 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)"
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && 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)"
# Ethernet
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="󰪎"
# TUN
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" "
printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon"

View File

@ -9,4 +9,4 @@ case $BUTTON in
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g"
pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/󰏔 /;s/^󰏔 0$//g"

View File

@ -16,8 +16,8 @@ esac
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
# If muted, print 🔇 and exit.
[ "$vol" != "${vol%\[MUTED\]}" ] && echo " " && exit
# If muted, print and exit.
[ "$vol" != "${vol%\[MUTED\]}" ] && echo " " && exit
vol="${vol#Volume: }"
@ -32,10 +32,10 @@ vol="$(split "$vol" ".")"
vol="${vol##0}"
case 1 in
$((vol >= 70)) ) icon="" ;;
$((vol >= 30)) ) icon="" ;;
$((vol >= 1)) ) icon="" ;;
* ) echo " " && exit ;;
$((10#$vol >= 70)) ) icon=" " ;;
$((10#$vol >= 30)) ) icon=" " ;;
$((10#$vol >= 1)) ) icon=" " ;;
* ) echo " " && exit ;;
esac
echo "$icon $vol%"