summaryrefslogtreecommitdiffstats
path: root/statusbar/sb-iplocate
blob: 02adab8d8808291a8af04e261d873b1d4c4040f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/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 "geoip" || exit
addr="$(curl ifconfig.me 2>/dev/null)" || exit
grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"