Shello

If there’s one thing that I’ve had missing in my life for way too long, it’s hacking on small silly stupid amusing little things. When I was young I used to write dozens of little pointless programs a week and forget about them, only to found them a few months later and be incredibly amused by them.

This afternoon I noticed that one of my machines didn’t have my default .bashrc loaded, which colourises (or ‘colorizes’ for Americans or ‘colourizes’ for Canadians) my shell so that I know on which machine I am so that I don’t accidentally do something silly like reboot the wrong host. One problem I’ve had with this is that there are limited colours available that makes sense to use for a shell prompt. Right as I was thinking this, I was looking at my Byobu screen sessions and thinking “Hmm! I like those logos, maybe I could use them in my shell!”.

So in just a few minutes I had a little script to help you configure those for your shell. Here is a screenshot of the shell logos in action. On my laptop I use a red background when I have a root shell:

This is what the shello script looks like that sets it up:

I might get bored by seeing it soon and get rid of it, but at least I had a little fun with it.

If you’d like to try it out, then you can get the script right here: https://github.com/highvoltage/shello

It doesn’t do anything like validating input yet, I’d also like to add something that creates some kind of a checksum of your hostname and choose a unicode character based on that. Maybe I’ll finish it up this weekend, or maybe I’ll have new things to write about!

You may also like...

2 Responses

  1. Gerald says:

    Very cool. I did something similar which automatically generated a new colour depending on your hostname, I’ll have to try yours out when I get the chance.

  2. Another useful tool to avoid rebooting the wrong host by mistake is the “molly-guard” package in Debian. It makes you type the hostname before “reboot” or “halt” are allowed to proceed.

Leave a Reply