DEV Community

Cover image for Give your linux terminal a makeover
Rob OLeary
Rob OLeary

Posted on • Updated on • Originally published at roboleary.net

Give your linux terminal a makeover

I decided to give my laptop a virtual makeover recently. One thing that stuck out was the terminal.

A terminal is a dark rectangle with text. It's utilitarian. There isn't a lot of options for making it stylish, but you can make it feel more personal with a few changes.

The 3 major things you can do is:

  1. Change the colour scheme: I made my own colour scheme. If you are searching, this repo is a great source for colour schemes for many different terminal apps.
  2. Pick a font: I installed a nerd font. Nerd fonts add icons to popular monospace fonts. These icons can be used in your text prompt and are used by some command-line applications to give more of a modern UI-feel. JetBrainsMono Nerd Font is my favourite.
  3. Modify the prompt text: You can configure the text yourself, or try a prompt theme such as powerlevel10k or pure. I installed Starship to make a custom prompt that works in a few different shells. It's got it's own config with a wide array of options to customize the text in every conceivable way. I use it to add: git info, low battery indication, and package/versioning info for some languages.

I guess these 3 things are what most people do in some shape or form.

custom terminal

And this is how my terminal looks! Simple and minimal is my preference.

Beyond that, you can make tweaks to use colours in more places. You can makes aliases which have the --colors=auto option included. These are the most common ones:



alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'


Enter fullscreen mode Exit fullscreen mode

If you use Zsh, you can add syntax highlighting to the commands, it gives feedback as you type. You can configure this yourself in your .zshrc, or use the zsh-syntax-highlighting plugin (script) to make it more straightforward.

syntax highlighting

You can see that when an incorrect command is typed, it is colored in red.

syntax highlighting error

Many people add this through Oh My Zsh, but it is not necessary to install Oh My Zsh. You just need to download the script somewhere and source the script in your .zshrc.



# leave as last source command
source ~/.config/zsh/scripts/zsh-syntax-highlighting.zsh


Enter fullscreen mode Exit fullscreen mode

Bash does not have an equivalent capability, unfortunately. There may be a script out there that does this, I haven't searched!

You can install command-line applications if you want to augment the appearance of some standard applications. For example, you can use lsd or exa instead of ls.

You can see that lsd uses a folder icon from the nerd font for folders, and breaks the list into columns. These applications offer some visual tweaks, but vary on the amount of styling you can do. I chose lsd because it offers a bit more control over appearance than exa.

lsd output

You can use bat instead of cat to add syntax highlighting to output.

bat

If you add the following to your shell configuration file, you will get highlighted man pages (as above).



# this uses bat (called batcat on debian) to colorize man pages
export MANPAGER="sh -c 'col -bx | batcat -l man -p'"


Enter fullscreen mode Exit fullscreen mode

Overall, this feels more personal as it is closer to my taste, but it lacks personality. What can I do to add more personality?

Some people like to make the terminal slightly transparent and show their desktop wallpaper. I don't! I love photography but I find it distracting!

transparent terminal

I noticed that some people use neofetch to flash their specs when they open a terminal. It's kind of badge of honour for some Linux enthusiasts.

neofetch

Seeing specs as kind of a greeting when I open a terminal is not my thing. But the ASCII art for the logo got me thinking. Some of the logos included in neofetch are quite stylish and colourful. And there is a palette to play with (them colorful boxes in the bottom right).

Could I create something like the logo but with a more polished appearance? Why do people say ASCII art? Don't we have unicode almost everywhere now? So, shouldn't there be more symbols to choose from now to make "better" text art?

The net result of my experimentation is fetching.

fetching logo

You can use it to fetch random unicode art. I wanted it to be a bit playful. I want to remind myself that this computer stuff is fun, and to enjoy myself while I'm doing it!

fetching mario example

The art is colored based on your terminal color scheme. Here are some examples side-by-side using different themes: the top-left theme is Dracula, the top-right is Solarized, the other two are just me playing around with colors - maybe I'm the first one to make an ultra high contrast Mario! 🤣I think the output has a different personality depending on your color scheme.

mario theme examples

I noticed that neofetch squashes the output if your terminal window is a bit narrow. I was able to make my scripts responsive to the terminal window. ✨

garbled output

The included image scripts were mostly inspired by:

  • abstract art, particularly the De Stijl movement with its simplified form and limited palette

mondrian

  • computer games, particularly from the 1980's and 1990's
    space invaders

  • street art
    obey

  • star wars

groku

I add the command fetching -r to my .zshrc to show a random image every time I open a terminal.

You can run it as a slideshow too if you want with fetching -s 2 , which shows a new image every 2 seconds!

slideshow

I think I have just scratched the surface. Unicode has approximately 143,859 unicode characters. These different forms and shapes have the potential for creating very different things.

I mostly used the Block Elements character set (as below). It facilitates creating blocky compositions with a smooth texture. As I practice and try out more characters, I think the output will be better and more variable.



█ ▉ ▊ ▋ ▌ ▍ ▎ ▏▐ ▕ ▇ ▆ ▅ ▄ ▃ ▂ ▁  ■ ▄ ▀  ▬ ▓ ▒ ░ 


Enter fullscreen mode Exit fullscreen mode

Check out the repo for more in-depth info. You need to have the Bash shell on your system installed to use it. There is an installation script to make it quick and easy to try it out. So, try it out!

GitHub logo robole / fetching

A collection of *fetching* unicode art for the terminal.

Fetching logo

Fetching

A collection of fetching unicode art for the terminal.

You have to be in a state of play to design. If you're not in a state of play, you can't make anything.

- Paula Scher

The goal is to add a touch of beauty to your terminal, and trigger a sense of play.

mario example

The art is colored according to your terminal color theme. The output can have a different personality depending on your color theme.

4 examples side-by-side of how the mario-xs image script using different color themes.

The included image scripts are responsive to the terminal window. This prevents distorted output in the random and slideshow modes. 🕶️

garbled output

There are 22 image scripts included inspired by:

  • abstract art, particularly the De Stijl movement with its simplified forms and limited palette

  • street art

    obey by invader

  • computer games, particularly from the 1980's and 1990's

  • star wars

I have a list of more images I would like to add (in todo.md). I will…




There is info on making your own images in there. I outline my "process". I don't know how sane or repeatable it is really! I enjoy this type of thing, it may be drudgery to you!

Let me know what you think. 🙂

Got any style tips?

If you have customized your terminal, share a screenshot as a comment! 📸


Thank you for reading! Feel free to subscribe to my RSS feed, and share this article with others on social media. 💌 🙂

Top comments (6)

Collapse
 
arunanshub profile image
Arunanshu Biswas

lsd is great. Although it sometimes messes up if you have bidirectional support turned on. And bat is by far the best thing I've seen ❤️! FiraMono or FiraCode is also a good choice as font.

Collapse
 
drsensor profile image
૮༼⚆︿⚆༽つ • Edited

Tips: you can use bat as your manpage renderer 😉

Collapse
 
robole profile image
Rob OLeary

Yes, I forgot about this. I have this configured also. I'll add it to the article, its nice to get highlighting on man pages

Collapse
 
robole profile image
Rob OLeary

mario

Collapse
 
drsensor profile image
૮༼⚆︿⚆༽つ • Edited

Check out zellij.dev

Collapse
 
robole profile image
Rob OLeary

Looks interesting 👍 I havent taken the plunge with a multiplexer yet. Kitty allows pane-splitting which is enough for me atm