mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
13 lines
489 B
Bash
Executable File
13 lines
489 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Displays the flag of the country you are in based on your public ip adress
|
|
#
|
|
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
|
|
|
|
ifinstalled "geoip" || exit
|
|
|
|
addr="$(curl ifconfig.me 2>/dev/null)" || exit
|
|
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
|