feat: migrate to i3blocks and autotiling-rs
This commit is contained in:
parent
ce241fd98d
commit
487870a473
14 changed files with 512 additions and 7 deletions
28
home/oli/bin/i3blocks/wifi
Executable file
28
home/oli/bin/i3blocks/wifi
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
. ~/bin/i3blocks/_utils
|
||||
|
||||
# Get WiFi signal strength
|
||||
wifi() {
|
||||
local wifidbm_orig=$(iwctl station wlan0 show | awk '/[[:space:]]RSSI/{print $2}')
|
||||
local wifidbm=$((wifidbm_orig * -1))
|
||||
if [[ $(echo "$wifidbm >= 50" | bc -l ) == "1" ]] && [[ $(echo "$wifidbm < 60" | bc -l ) == "1" ]]; then
|
||||
local bg=$warn1_bg
|
||||
local fg=$warn1_fg
|
||||
elif [[ $(echo "$wifidbm >= 60" | bc -l ) == "1" ]] && [[ $(echo "$wifidbm < 70" | bc -l ) == "1" ]]; then
|
||||
local bg=$warn2_bg
|
||||
local fg=$warn2_fg
|
||||
elif [[ $(echo "$wifidbm >= 70" | bc -l ) == "1" ]]; then
|
||||
local bg=$crit_bg
|
||||
local fg=$crit_fg
|
||||
fi
|
||||
local stat="NET -${wifidbm} dBm"
|
||||
|
||||
if [[ -n "$bg" ]]; then
|
||||
echo -e "<span background=\"$bg\" color=\"$fg\">$stat</span>\n"
|
||||
else
|
||||
echo -e "$stat\n"
|
||||
fi
|
||||
}
|
||||
|
||||
wifi
|
||||
Loading…
Add table
Add a link
Reference in a new issue