diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-09-02 17:36:35 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-09-02 17:36:35 +0800 |
| commit | 582c7ad0569e4bc52a86b38e9a51f07f41842e15 (patch) | |
| tree | 49bd07d6e6cfc85ee9d825ead224fbaed98160b4 /network-status | |
| parent | 4bafe49e51237da9f4f92c935912426d3661cc11 (diff) | |
init hyprland scripts
Diffstat (limited to 'network-status')
| -rwxr-xr-x | network-status | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/network-status b/network-status new file mode 100755 index 0000000..ae54aeb --- /dev/null +++ b/network-status @@ -0,0 +1,27 @@ +#!/bin/sh + +status="$(nmcli general status | grep -oh "\w*connect\w*")" + +if [[ "$status" == "disconnected" ]]; then + printf " " +elif [[ "$status" == "connecting" ]]; then + printf " " +elif [[ "$status" == "connected" ]]; then + # strength="$(nmcli -f IN-USE,SIGNAL device wifi | grep '*' | awk '{print $2}')" + strength="$(python $HOME/scripts/wifi-conn-strength)" + if [[ "$?" == "0" ]]; then + if [[ "$strength" -eq "0" ]]; then + printf " " + elif [[ ("$strength" -ge "0") && ("$strength" -le "25") ]]; then + printf " " + elif [[ ("$strength" -ge "25") && ("$strength" -le "50") ]]; then + printf " " + elif [[ ("$strength" -ge "50") && ("$strength" -le "75") ]]; then + printf " " + elif [[ ("$strength" -ge "75") && ("$strength" -le "100") ]]; then + printf " " + fi + else + printf " " + fi +fi |
