iplocate module added

This commit is contained in:
Luke Smith 2019-04-23 10:43:57 -04:00
commit 47b955673d
2 changed files with 12 additions and 0 deletions

View file

@ -17,6 +17,9 @@ label=📰
interval=once interval=once
signal=6 signal=6
#[iplocate]
#interval=30
[pacpackages] [pacpackages]
label=📦 label=📦
interval=once interval=once

9
.scripts/statusbar/iplocate Executable file
View file

@ -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/;.*//"