diff options
author | ryo <ryo@nopwd.lol> | 2024-10-30 20:10:03 +0000 |
---|---|---|
committer | ryo <ryo@nopwd.lol> | 2024-10-30 20:10:03 +0000 |
commit | cc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 (patch) | |
tree | f7f751a92c30b5ef7cf8770004c30479c516fdca /config/i3blocks/scripts/iface |
Initial commit
Diffstat (limited to 'config/i3blocks/scripts/iface')
-rwxr-xr-x | config/i3blocks/scripts/iface | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/config/i3blocks/scripts/iface b/config/i3blocks/scripts/iface new file mode 100755 index 0000000..cc11a07 --- /dev/null +++ b/config/i3blocks/scripts/iface @@ -0,0 +1,10 @@ +#!/usr/bin/env dash + +table=$(ip route get 1) +if [ $? -ne 0 ]; then + echo "Offline" + exit 0 +fi + +ip=$(echo $table | sed -n 's/.*src \([0-9.]\+\).*/\1/p') +echo $ip |