chickencode: (Default)


I've always been a big fan of editing my shell to display custom ascii art for as long as I could remember. There is something fun about being greeted by a familiar artistic image before diving into work.

nyan cat ascii shell

One thing I've really been interested in trying is creating animated ascii art displayed in my shell, and so thats what I did.

First thing I did was find a gif that I liked and was simple enough to use as animated ascii art.
I ended up settling on ...an animated chicken.



Now that I had my gif I needed to extract each frame from it which I did with the following tool
https://www.gif-explode.com/



I created a folder to store all the gif frames into for easy organization then one by one converted them into ascii art images.

http://picascii.com/

Now that I had the ascii art I needed it was time to edit my
~/.bashrc

I created a function at the end of the ~/.bashrc that looped through the contents of the ascii art based on number of frames.

function animate_chicken {
    for i in {1..17}
    do
      cat /home/james/chicken/$i.txt | lolcat
      sleep 0.1
      clear
    done
}


animate_chicken


After you save your ~/.bashrc file you need to source it source ~/.bashrc and you will now have an animated ascii prompt when you open your terminal. There are many other things you can do within the loop to make the animation better like give certain frames more or less sleep time to show speed variation etc..


Final product

Profile

chickencode: (Default)
chickencode

March 2017

S M T W T F S
   1234
5 67891011
12131415161718
19202122232425
262728293031 

Syndicate

RSS Atom

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 23rd, 2017 03:53 am
Powered by Dreamwidth Studios