summaryrefslogtreecommitdiff
path: root/i3/.config/i3blocks/bin/wifi
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2018-02-21 12:18:32 +0000
committerUrbain Vaes <urbain@vaes.uk>2018-02-21 16:46:29 +0000
commitb9ea238dd7e8a56b1d171cdc76e405bb2a8584dd (patch)
treed693deb61965b724cd8630e0a061e5e762341c9c /i3/.config/i3blocks/bin/wifi
parent68d822599f074c24505eea2329bfc80e2745feab (diff)
Improve i3 status
Diffstat (limited to 'i3/.config/i3blocks/bin/wifi')
-rwxr-xr-xi3/.config/i3blocks/bin/wifi10
1 files changed, 8 insertions, 2 deletions
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