summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-04-23 10:43:57 -0400
committerLuke Smith <luke@lukesmith.xyz>2019-04-23 10:43:57 -0400
commit47b955673d66f266e7c091a4f9d9bcb45c002a5f (patch)
tree631b6e4d9872d1e87bd33f4b876cc5aa928cb606
parent9eceb54bfd05e212411e3897bb4b5caff1a991e9 (diff)
parentfbe14a9a068350309453994341cee59bacc5faea (diff)
downloadeibhear-47b955673d66f266e7c091a4f9d9bcb45c002a5f.tar.gz
eibhear-47b955673d66f266e7c091a4f9d9bcb45c002a5f.tar.zst
eibhear-47b955673d66f266e7c091a4f9d9bcb45c002a5f.zip
iplocate module added
-rw-r--r--.config/i3blocks/config3
-rwxr-xr-x.scripts/statusbar/iplocate9
2 files changed, 12 insertions, 0 deletions
diff --git a/.config/i3blocks/config b/.config/i3blocks/config
index e984724..06edb86 100644
--- a/.config/i3blocks/config
+++ b/.config/i3blocks/config
@@ -17,6 +17,9 @@ label=📰
interval=once
signal=6
+#[iplocate]
+#interval=30
+
[pacpackages]
label=📦
interval=once
diff --git a/.scripts/statusbar/iplocate b/.scripts/statusbar/iplocate
new file mode 100755
index 0000000..4ca4f10
--- /dev/null
+++ b/.scripts/statusbar/iplocate
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Gets your public ip address checks which country you are in and
+# displays that information in the statusbar
+#
+# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
+ifinstalled "geoiplookup" || exit
+addr="$(curl ifconfig.me 2>/dev/null)" || exit
+grep "flag: " ~/.config/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"