aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2024-08-03 10:06:05 +0100
committerJustine Smithies <justine@smithies.me.uk>2024-08-03 10:06:05 +0100
commit63371b00d53fbd146a6d09da40784bc6d653f755 (patch)
tree8df335c9b48ca903f724f10fe8dd955469079986 /.config/eww/scripts
parentbcd3ec619ee5819ad5a0196717c4a9726e13b5c3 (diff)
Fixed formatting of network status information in notification
Diffstat (limited to '.config/eww/scripts')
-rwxr-xr-x.config/eww/scripts/network.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/.config/eww/scripts/network.sh b/.config/eww/scripts/network.sh
index f780d5b..a554919 100755
--- a/.config/eww/scripts/network.sh
+++ b/.config/eww/scripts/network.sh
@@ -15,8 +15,7 @@
function ShowInfo {
if [ "$(nmcli connection show --active | grep -oh "\w*ethernet\w*")" == "ethernet" ]; then
wan="$(dig @resolver4.opendns.com myip.opendns.com +short)"
- connection="$(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' '): $(nmcli connection show --active | grep 'ethernet' | awk '{ print $1 }' FS=' ') $(nmcli -t -f IP4.ADDRESS dev show $(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' ') | awk '{print $2}' FS='[:/]')
-WAN IP: $wan"
+ connection="$(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' '): $(nmcli connection show --active | grep 'ethernet' | awk '{ printf "%s\nLAN IP:",$1 }' FS=' ') $(nmcli -t -f IP4.ADDRESS dev show $(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' ') | awk '{printf "%s\nWAN IP: '$wan'", $2}' FS='[:/]')"
elif [ "$(nmcli connection show --active | grep -oh "\w*wifi\w*")" == "wifi" ]; then
wan="$(dig @resolver4.opendns.com myip.opendns.com +short)"
connection="$(nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' '): $(nmcli connection show --active | grep 'wifi' | awk '{ print $1 }' FS=' ') - $(nmcli -t -f IP4.ADDRESS dev show $(nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' ') | awk '{print $2}' FS='[:/]')