diff --git a/.config/i3blocks/config b/.config/i3blocks/config index e984724..06edb86 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -17,6 +17,9 @@ label=📰 interval=once signal=6 +#[iplocate] +#interval=30 + [pacpackages] label=📦 interval=once 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/;.*//"