mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-04-11 15:46:55 +02:00
33 lines
650 B
Bash
Executable file
33 lines
650 B
Bash
Executable file
#!/bin/bash
|
|
|
|
status=$(nmcli g | grep -oE "disconnected")
|
|
essid=$(nmcli c | grep wlp0s20f0u6 | awk '{print ($1)}')
|
|
strength=$(awk 'NR==3 {printf("%.0f\n",$3*10/7)}' /proc/net/wireless)
|
|
|
|
if [ $status ]; then
|
|
icon=""
|
|
text=""
|
|
col="#f38ba8"
|
|
|
|
else
|
|
if [ $strength -le 25 ]; then
|
|
icon=""
|
|
elif [ $strength -le 50 ]; then
|
|
icon=""
|
|
elif [ $strength -le 75 ]; then
|
|
icon=""
|
|
else
|
|
icon=""
|
|
fi
|
|
|
|
text="${essid}"
|
|
col="#b4befe"
|
|
fi
|
|
|
|
if [[ "$1" == "--COL" ]]; then
|
|
echo $col
|
|
elif [[ "$1" == "--ESSID" ]]; then
|
|
echo $text
|
|
elif [[ "$1" == "--ICON" ]]; then
|
|
echo $icon
|
|
fi
|