voidrice/.local/bin/statusbar/iplocate
2020-04-04 13:00:08 -07:00

9 lines
387 B
Bash
Executable file

#!/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: " $XDG_CONFIG_HOME/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"