From d54737ee28260779e24780be1ee3dd3e0e05fca2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 23 Feb 2020 23:11:34 +0000 Subject: [PATCH] polybar: add v4/v6 gateway ping check --- .config/polybar/config | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.config/polybar/config b/.config/polybar/config index 5a8b788..4326d38 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -46,8 +46,8 @@ line-colour = #f00 modules-left = i3 modules-center = -# modules-right = volume updates weather xkeyboard wlan eth memory cpu xbacklight battery temperature date -modules-right = volume updates weather wlan eth memory cpu xbacklight battery temperature date +# modules-right = volume updates weather xkeyboard wlan gateway eth memory cpu xbacklight battery temperature date +modules-right = volume updates weather wlan gateway eth memory cpu xbacklight battery temperature date tray-position = right tray-detached = false @@ -76,6 +76,13 @@ exec = $XDG_CONFIG_HOME/polybar/weather.sh interval = 120 click-left = i3-msg exec "i3-sensible-terminal -r floating-term -e 'sh -c \"xdotool getactivewindow windowsize 910 680 && curl wttr.in && sleep infinity\"'" +[module/gateway] +type = custom/script +exec = for v in 4 6; do ip -$v r show default | xargs -l1 sh -c 'fping --retry=1 --quiet --iface "$4" "$2"'; done && echo  || echo '%{F#f41f1c}%{F-}' +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colours.icon} + [module/xkeyboard] type = internal/xkeyboard