refactored batteries script, tscale_native uses core utils instead of rg and jq
This commit is contained in:
20
i3/.config/i3blocks/workvpn
Executable file
20
i3/.config/i3blocks/workvpn
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
status=$(ip a show ppp1 2>/dev/null || "")
|
||||
[ -z "$status" ] && exit 0
|
||||
|
||||
icon=
|
||||
color="#808080"
|
||||
text=""
|
||||
ip=$(grep -Po 'inet \K(\d+\.){3}\d+' <<<$status)
|
||||
if [ -z "$ip" ]; then
|
||||
text="$icon wait..."
|
||||
color="#ffff00"
|
||||
else
|
||||
text="$icon $ip"
|
||||
color="#80ff80"
|
||||
fi
|
||||
|
||||
echo "$text"
|
||||
echo "$text"
|
||||
echo "$color"
|
||||
Reference in New Issue
Block a user