No ads? Contribute with BitCoins: 16hQid2ddoCwHDWN9NdSnARAfdXc2Shnoa
Jan 252019
 

If you are using the right kind of terminal that supports graphics inline (such as KiTTY), then you can write simple (or complex) tools that insert images into the terminal.

Being able to display the flag of a country (if you know its two-letter ISO code) is kind of trivial but useful if you need it.

And a shell function to do that is remarkably simple :-

function flag {
    wget -o /dev/null -O /var/tmp/flag.$$ http://flagpedia.net/data/flags/normal/${1}.png
    if [ $? -eq 0 ]
    then
        kitty +kitten icat /var/tmp/flag.$$ && rm /var/tmp/flag.$$
    else
        echo Not found
    fi
}

(that’s a Zsh function which may require adaption to Bash).

WP Facebook Auto Publish Powered By : XYZScripts.com

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close