File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,19 @@ set -euo pipefail
44
55command -V wg-quick & > /dev/null || exit 0
66
7+ GREEN=" #55AA00"
8+ RED=" #FF2200"
9+ UG=" %{U$GREEN }"
10+ UR=" %{U$RED }"
11+ FG=" %{F$GREEN }"
12+ FR=" %{F$RED }"
13+ URST=" %{U$LEMON_UN }"
14+ FRST=" %{F$LEMON_FG }"
15+
16+ paint () {
17+ printf " %%{r}%s%s%s" " $1 " " $2 " " $3 "
18+ }
19+
720ip -color=never -o -d link show |
821 awk ' /wireguard/ {print $2}' |
922 tr -d : |
@@ -13,10 +26,15 @@ ip -color=never -o -d link show |
1326 grep -o -E ' [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+' |
1427 cut -d/ -f1 |
1528 sed -E ' s/\.[0-9]+$/.1/' )
29+ printf " "
1630 if ping -w 1 -c 1 " $fst_address " & > /dev/null; then
17- printf ' %%{F#55AA00}[%s]%%{F-}' " $network "
31+ paint " $UG " " $FG " " ["
32+ paint " $UG " " $FRST " " $network "
33+ paint " $UG " " $FG " " ]"
1834 else
19- printf ' %%{F#FF2200}[%s]%%{F-}' " $network "
35+ paint " $UR " " $FR " " ["
36+ paint " $UR " " $FRST " " $network "
37+ paint " $UR " " $FR " " ]"
2038 fi
2139 done
2240
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ x-scheme-handler/msteams=teams.desktop
1616x-scheme-handler/discord-402572971681644545=discord-402572971681644545.desktop
1717x-scheme-handler/sgnl=signal.desktop
1818x-scheme-handler/signalcaptcha=signal.desktop
19+ x-scheme-handler/freetube=freetube.desktop
1920
2021[Added Associations]
2122application/octet-stream=gvim.desktop;
You can’t perform that action at this time.
0 commit comments