Artii, Lolcat, Colorls, Catpix, and other Ruby gems to add color to Your terminal
ryanwhocodes Nov 7 Updated on Nov 09, 2018
As well as making your terminal more colorful through your shell prompt theme, font, and color settings, you can add even more features by using Ruby gems, such as artii, lolcat, colorls, and catpix.
To use them, ensure you have Ruby installed on your computer, and then you can install each one using the command
gem install. For example:
gem install lolcat
This gem adds a rainbow gradient to anything that you pipe through to it. The image at the top of the post pipes ASCII art text generated with the Aarti gem through lolcat to create a colorful heading in the terminal.
artii 'Ruby Gems' --font slant | lolcat
You can combine extra bash commands to animate it, in this case
echo to print the string passed to it,
-a to animate, and
-d for duration.
echo I ❤ Ruby | lolcat -a -d 500
This enhances the terminal command ls with color and icons. Below is a screenshot from its Github repo. This configuration is an iTerm2 terminal (Mac OS), with oh-my-zsh with powerlevel9k theme and powerline nerd-font + awesome-config font with the Solarized Dark color theme.
You can make it as easy to use as ls by adding an alias for lc to your
This converts images to a format that can render on a terminal screen. You can try having an image loaded into your terminal when it starts or when there is an event — for example when your tests pass.
Find out more
These are just some of the Ruby gems that can enhance your terminal, and learning how they work means you can customize your command line. You could even take it further by adding a special setup for irb and pry, such as irbtools.
Find out more about the Ruby gems on Github
Ruby too slow?
Ruby is a high-level interpreted programming language, so can be slower for certain tasks than compiled and lower level programming languages. If you like the idea of these, but concerned about speed, then you might find some alternatives written in languages such as Bash, Rust or Go.
Originally published at medium.freecodecamp.org