From 56d418e5259eee850f2afa10d8dd4260e6d42683 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 23 Apr 2019 10:43:23 -0400 Subject: [PATCH] avoid conflict with `locate` --- .scripts/statusbar/iplocate | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 .scripts/statusbar/iplocate 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/;.*//"