2019-04-23 10:26:31 -04:00

14 lines
467 B
Plaintext
Executable File

#/bin/bash
# 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/
# To get the flag-emojis file:
#
# curl https://samerickson.me/files/flag-emojis > ~/.local/share/flag-emojis
#
addr="$(curl ifconfig.me 2>/dev/null)"
country="$(geoiplookup $addr | awk '{print $5}')"
printf "%s" "$(sed -n /$country/p ~/.local/share/larbs/flag-emojis)"