Thursday, December 17, 2009

Geektool Desktop

So a while back I downloaded this great little program for my mac. It's called Geektool, and it's free, you can download it here. Basically, it's an automatic command line-running tool, that will display anything you can possibly run in a unix terminal, as well as system logs, and pictures, right on your desktop. Everything runs in the background and is always on the desktop. You can change the font colors and sizes, and place them anywhere on the desktop.

I'm posting here to describe what I have recently done with a couple real simple scripts and some help with photoshop. I am a huge Assas
sin's Creed fan, and with the new one being released, I thought I should spice it up a little b

Currently this is my desktop, using Geektool and a couple scripts I wrote real quick to change the configurations of the lettering.

So, I found the Ezio image on Google images, and the background had a few stars in it, but I went along and Photoshopped the large, faded Assassin's logo somewhat behind Ezio and pulled the "Assassin's Creed II" closer to the center of the picture.

Now for the scripts which enabled me to mimic the font and positions of the words for the date. The simplest way to do this, is to just use Geektool to run some separate shell scripts.

date +%B <- Gives you the current month.
date +%A <- Gives you the current day.
date +%d <- Gives you the current day (number).
date +%Y <- Gives you the current year.

Then all you have to do is position the scripts, change the fonts and colors, and you're all set. They actually have a matching font built right in, it's called Trajan Pro (yes, yes, hehe, let's all get the giggles out first). The only problem with this is that, although it is the same font, it does not perfectly match the Assassin's Creed logo, and being the perfectionist that I am, I needed to find a quick and dirty way to get it to look as much like the logo as I could. This is where the scripts come in to play. If you are familiar with writing scripts, this should be fairly easy. If you are not, I am still fine-tuning them to make sure they work for every day, in every month, and still holds the perfect font we're looking for in our output. As soon as I am sure that the scripts work for everything, so long as you set the font and position correctly, I will post them.

For now, however, I will merely describe what they do, so all you people out there who know how to write scripts, can write your own, maybe you can come up with a better one than I have.

Originally, I was calling if statements, and in each one I was using grep to search for certain letters in the "date +%A" and then acting based on that. Now, I have realized that it is much more efficient to merely call "date +%A" once, and then do if statements for each of the 7 days of the week. Based on which day it is, I pull out all the letters except the first and last, and leave enough spaces in between to account for the missing letters. The script then outputs my results (the two letters with spaces in between) to the console. This is the first script. The second script uses the same method, but instead of removing the inside letters, it removes just the first and last letters of the day, and outputs that. Make sure that you save your scripts as .scpt and that they are in a location that you can remember and access easily later on.

Now that we have the scripts, we can run them using Geektool. Go into Geektool, and place a new "Shell" anywhere on your desktop. For the code that will be executed in the shell, type "osascript /The/Location\ of\ Your/Script_File.scpt". Now you have Geektool running the script file, set the interval which you would like it to update, and change the font to Trajan Pro, with the size and color you would like. Do the same thing for the other script, and you are good to go. Like I mentioned before, I have not made the scripts absolutely perfect yet, the spacing for particular days and months still is not exact, but as soon as I know that they are working perfectly, I will post them.

No comments: