aboutsummaryrefslogtreecommitdiff
path: root/.i3-blocks/blocks/ip-address
diff options
context:
space:
mode:
Diffstat (limited to '.i3-blocks/blocks/ip-address')
-rwxr-xr-x.i3-blocks/blocks/ip-address9
1 files changed, 9 insertions, 0 deletions
diff --git a/.i3-blocks/blocks/ip-address b/.i3-blocks/blocks/ip-address
new file mode 100755
index 0000000..d91ab56
--- /dev/null
+++ b/.i3-blocks/blocks/ip-address
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+IP_ADDRESS=$(ip route get 1 | awk '{print $NF;exit}')
+
+if [[ "${IP_ADDRESS}" != "" ]]; then
+ echo "${IP_ADDRESS}"
+ echo "${IP_ADDRESS}"
+ echo ""
+fi \ No newline at end of file