I recently installed system indicator monitor by fossfreedom (https://github.com/fossfreedom/indicator-sysmonitor) and I am able to add a custom shell command.
Since I VPN to many different servers around the world, I would like to have this monitor show a flag icon based on location. Currently, I configured it to show two letter country code (e.g. US, UK, BR, etc.), but I want it to replace this with the location of a flag icon in my directories.
I installed a series of flag icons from famfamfam-flag-png, which installs 16x11 flag pngs here: /usr/share/flags/countries/16x11/
So using the 'indicator-sysmonitor' I thought I can add a custom script ($HOME/scripts/checklocation
) such as:
curl ipv4.icanhazip.com | curl ipinfo.io | grep country | awk '{print $2}' | sed 's/,//g' | sed 's/"//g'
which reports the two letter country code, then I can replace it with the path to the appropriate icon. But I am not sure how to do this... Need help configuring my custom script above to report the appropriate flag icon and then to make it work so it would replace 'LOC: BR' with just the flag for BR in my panel.