mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Update sb-iplocate
This commit is contained in:
parent
5a6c56d565
commit
6dd6fac293
@ -1,10 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Gets your public ip address checks which country you are in and
|
# Displays the flag of the country you are in based on your public ip adress
|
||||||
# displays that information in the statusbar
|
|
||||||
#
|
#
|
||||||
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
|
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
|
||||||
|
|
||||||
ifinstalled "geoip" || exit
|
ifinstalled "geoip" || exit
|
||||||
|
|
||||||
addr="$(curl ifconfig.me 2>/dev/null)" || 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/;.*//"
|
country="$(geoiplookup "$addr" | sed -e 's/^[^,]*, //' -e 's/,.*$//')" # Keep only between 1st and 2nd comma
|
||||||
|
grep "flag: $country" "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/chars/emoji" |
|
||||||
|
sed 's/flag:.*//' # Remove everything from 'flag:' onward
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user