From b9ea238dd7e8a56b1d171cdc76e405bb2a8584dd Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 21 Feb 2018 12:18:32 +0000 Subject: Improve i3 status --- i3/.config/i3blocks/bin/wifi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'i3/.config/i3blocks/bin/wifi') diff --git a/i3/.config/i3blocks/bin/wifi b/i3/.config/i3blocks/bin/wifi index 434c508..bc24672 100755 --- a/i3/.config/i3blocks/bin/wifi +++ b/i3/.config/i3blocks/bin/wifi @@ -6,10 +6,16 @@ wifi_address=$(ip addr show wlp2s0 2>/dev/null | grep -oP -m1 "(?<=inet ).*(?=/) eth_address=$(ip addr show eno1 2>/dev/null | grep -oP -m1 "(?<=inet ).*(?=/)") if [[ -n $eth_address ]]; then - echo "eno1: $eth_address" + full_text="eno1: $eth_address" + ip_addr="$eth_address" elif [[ -n $wifi_address ]]; then - echo "wlp2s0: (${quality}% at ${ssid}) ${wifi_address}" + full_text="wlp2s0: (${quality}% at ${ssid}) ${wifi_address}" + ip_addr="$wifi_address" else echo "No connection" fi +case $BLOCK_BUTTON in + 1) echo "$full_text" ;; + *) echo -e "$ip_addr" ;; +esac -- cgit v1.2.3