From 343e89812a2e94fc5e0dd0e3a11401ce7cf2ef73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sun, 31 May 2020 23:17:04 -0500 Subject: [PATCH] iface: improve extract ip --- scripts/i3blocks/iface | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/i3blocks/iface b/scripts/i3blocks/iface index 30ccd9a..a6703f4 100755 --- a/scripts/i3blocks/iface +++ b/scripts/i3blocks/iface @@ -54,7 +54,7 @@ then fi # Check local ip address -IPADDR=$(ip -f inet addr show dev "$IF" | sed -n 's/^ *inet *\([.0-9]*\).*/\1/p') +IPADDR=$(ip route get 4.2.2.1 | grep -oE "src [.0-9]+" | awk '{print $NF;exit}') case $BLOCK_BUTTON in 3) echo -n "$IPADDR" | xclip -q -se c ;;