Your Computer CAN Love You!

Ferris Boran
4 min readApr 17, 2019

--

Make the computer work for you!

This is my first blog post! I’m not good at introductions so let’s get started…

I will say I’m a pretty lazy person. I’ve been told that “efficient” is the positive way to express that. However, everyone will say they’re efficient, but not a lot of people will admit they are lazy.

I recently started a coding boot camp but before that, I worked a lot inside of a terminal on a Mac/Linux computer. I never really “developed” anything that the whole company would use but I definitely created a crap ton of short cuts for myself to execute the crap ton of commands I had to use every day. And then, when I was REALLY bored, I was able to figure out how to automate all of them to make my life even easier! But, that’s not what this post is going to cover … (Subscribe for more 😜)

Today we’ll be going over how to customize your terminal ever so slightly! So slightly that you’ll probably forget about it until someone looks at your terminal and says “Oh cool! How’d you do that?!”

Oh, bash! You’re so sweet!

Intro tldr; Customize the terminal in Mac

Wouldn’t it be nice if every time you opened a new terminal window it welcomed you with open arms? The obvious answer is YES!

First things first — Find out where your computer is loading terminal from. From the command prompt, run echo $SHELL and pay close attention to what the computer tells you!

Most Macs will say /bin/bash but, if you blindly downloaded any packages from the internet to get this super specific thing on your computer to work, it may have changed that path. There are fancy & less fancy ways to change it back to /bin/bash but it doesn’t matter. If it’s NOT /bin/bash, make sure to edit the path to match as you follow along!

I’m going to assume you know a little bit about navigating through the terminal but if not, let me know! I’ll gladly explain what is actually happening (Seriously… I’ll need blog topics for said boot camp), for the time being just copy & paste

  1. nano ~/.bash_profile — If you didn’t have /bin/bash show up, be sure to replace the ~ with the path that did. Press ‘return’ and the nano editor pops open. Don’t mind all the fancy crap at the bottom for now.
  2. If you want a new random message to populate follow the steps below. If you’re cool with just one over and over and over again, skip to step 7.
  3. Press the down arrow until you get to an empty line. Copy and paste the following being sure to press ‘return’ after every line.
  4. arr[0]="Hey! Doing some computing today?" or put your own message between the quotes!
  5. arr[1]="Opening for you was such sweet sorrow!" Again, you can enter in your own stuff.
  6. Repeat the previous step being sure to increase the number within the []

Awesome! Now we have a bunch of nice things the terminal wants to say!

6. rand=$[ $RANDOM % 3 ] where “3” is the number of compliments you told your computer to say (I wrote 3 lines in the above picture so I put down 3)

7. echo ${arr[$rand]} -or- echo "I only need one compliment" -or- tell a whole story! Putting anything after echo will make it populate in the terminal.

8. Press ctrl+o to save, and ctrl+x to exit (Yes, the ‘control’ button. Not ‘command’)

— — Sidebar, if for some reason you get an error saying you don’t have permission to overwrite, press ctrl+x to exit, sudo !!, enter your computer login password, and repeat.

9. Woo! Now your computer is just itching to compliment you! There are two ways you can make this happen — Close and reopen the terminal -or- source ~/.bash_profile remember to replace the ~ if you had to at the beginning.

Why, Ferris? Why?! If I have to look at it all freaking day I’m going to make it nice to look at!!

--

--