diff options
| author | 0scar <qgt268@alumni.ku.dk> | 2021-06-03 21:33:31 +0000 |
|---|---|---|
| committer | 0scar <qgt268@alumni.ku.dk> | 2021-06-03 21:33:31 +0000 |
| commit | 6e4a15d79352ca2707a3b0d81d158228a7d14704 (patch) | |
| tree | a526da4169c76175f1e528534d67772bc13dfabb /.scripts/netinfo | |
| parent | a38dc1a774d012b2da71716365d1d254b650dd48 (diff) | |
Add/move statusbar scripts
Diffstat (limited to '.scripts/netinfo')
| -rwxr-xr-x | .scripts/netinfo | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/.scripts/netinfo b/.scripts/netinfo deleted file mode 100755 index ceb79f7..0000000 --- a/.scripts/netinfo +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env sh - -netstatus="$(awk '{ - n = split(FILENAME, a, "/") - printf("%-15s %s\n", a[n-1], $1) - }' /sys/class/net/[ew]*/operstate | sort -k 2)" - -function add_connected_address() { - TMPIFS=$IFS - IFS=' -' - for line in $netstatus; do - device=$(echo $line | awk '{print $1}') - address=$(ip addr show $device | sed -En 's/inet ([0-9\.]+).*/\1/p') - # Append Wifi AP if connected - [ -n "$address" ] && address=$address" ("$(iwgetid -r)")" - echo $line $address - done - IFS=$TMPIFS -} - -case $BLOCK_BUTTON in - 1) notify-send --urgency=low "Internet connection" "$(add_connected_address)" ;; -esac - -#echo "$(echo -e "$netstatus" | sed -En '/up$/p')" -#echo ====== - -if [ -z "$(echo -e "${netstatus}" | sed -En '/up$/p' | tr -d '\n')" ]; then - echo -n '' -else - echo -n "${netstatus}" | sed -En 's/^(w[^ ]+).*up//p;s/^(e[^ ]+).*up//p' -fi - |
