Tyler Kieft

Web entrepreneur and smart grid enthusiast

  • Blog
  • Projects
  • About Me
  • Contact

November 2, 2006
Posted by Tyler

Random Color Terminal

I’ve always wanted something like this. Daniel Jalkut of the Red Sweater Blog has created an AppleScript to randomize the color scheme of the terminal. Just drop it in ~/Library/Scripts/Applications/Terminal and it will show up in the script menu under “Terminal Scripts.” Click on it until you find a color scheme that pleases you.

There are two cool hacks that I came up with for this script. Both involve changing ~/.bash_profile (or the startup script for whatever shell that you use). If you don’t have a file named .bash_profile in your home directory, then create one. AppleScripts can be invoked from the command line by using the osascript command, and we can use this to our advantage in two ways.

  1. Every time we start up a new terminal, randomize the color. Simply add the line

    osascript ~/Library/Scripts/Applications/
    Terminal/RandomColorTerminal.scpt

    somewhere in your .bash_profile (all on one line).

  2. Set an alias to the above command so that we can change the color very quickly without needing to navigate to the script menu with the mouse. To do this, add the line

    alias newcol='osascript ~/Library/Scripts/Applications/
    Terminal/RandomColorTerminal.scpt'

    to .bash_profile (all on one line). Now, whenever you type newcol at the command line, you will get a new color scheme.

2 Comments

Posted Under Apple Software Technical

  • http://www.red-sweater.com/blog/ Daniel Jalkut

    Hey – glad you like the script! Minor correction, you’ll have to put an “Applications” directory in there in the Scripts folder path, to make it show up correctly in the script menu only under Terminal.

  • http://snier.com Tyler

    Yes – good call. I got it in the right place on my computer, but typed it wrong in the post. That’s what happens when you try to type in paths from memory :)

    In any case, the path is now correct.

    • Posts
    • Twitter
    • Flickr
     

    End Game

    Entrepreneurship

     

    You Don’t...

    Rochester

     

    Big Basin...

    Hiking

     

    Hiking Mt. Diablo

    Hiking

    RT @mbrandolph: I hate firing people. My first new post in 3 months. #backinthesaddleagain. http://t.co/DdAoxnmZ

    follow me on
    twitter

    IMG_9408IMG_9399IMG_9414IMG_9411IMG_9403IMG_9386IMG_9378IMG_9352IMG_9377IMG_9369IMG_9368IMG_9358
  • Archives

    • 2011
      • April
      • May
      • November
    • 2010
      • October
    • 2008
      • February
      • March
      • April
      • May
      • June
    • 2007
      • January
      • February
      • March
      • April
      • May
      • June
      • July
    • 2006
      • September
      • October
      • November
      • December

This site is using the Handgloves WordPress Theme
Designed & Developed by George Wiscombe

Subscribe via RSS