-->

Archive for the 'Tutorial' Category

Rearrange Your Menu Bar Icons

While staring at my Menu Bar today I thought to myself, there’s got to be a way to move those icons around. I tried the ol’ faithful drag with no luck. Then, as only a true keystroke freak would attempt, I began testing out modifier keys. I began with the normal keys. ctrl… alt… aha! The Apple key did the trick :)

MenuBar Icons

If you feel the need to rearrange your menu bar icons, then simply hold down the command key, click on one of the icons, and drag it to a new position. Neat huh? If you have other menu bar icons from applications like Quicksilver, You Control: Tunes, or Visor you’ll immediately notice that this trick doesn’t always work.

Move Menu Bar Icons

There are two types of Menu Bar icons, the built-in OS X menu bar icons and 3rd party application icons. You may use this trick to rearrange the OS X icons among each other. However, you cannot move the OS X icons into the 3rd party application icon territory. I should also note that you cannot move the Spotlight icon either.

Remove PoofAt some point in time you may want to clean up your menu bar a bit and remove any unused icons. The command + drag trick also works for removing icons. Just hold the command key down and drag the icon off the menu bar. You’ll see a small puff of smoke appear as the icon is removed, similar to what happens when you remove an icon from the dock. Be sure that you only remove icons that you really want off your menu bar, because there is no way to easily undo this. If you make a mistake or change your mind you’ll have to go poking around the System Preferences to find the option to turn the icon back on again.

I don’t know how I didn’t run across all this sooner. I’m sure there are long time Mac users that still don’t know this simple trick!  I guess that’s why I’m here :)

Comments

Make Your Dock Transparent With ClearDock

ClearDock IconYou’ve got a snazzy desktop picture, and a killer GeekTool stats/info display. But something is missing. Your dock just doesn’t jive with everything you’ve got setup. Not even setting the dock up to auto hide will please you. I was in that boat a few weeks ago, and now Mathew, the proud owner of a brand new MacBook is as well. Matt wrote me a quick email today asking for assistance.

I was wondering whether you’d ever come across a way to get the dock background to disappear/become transparent? I can’t seem to find an option anywhere and you seem to be the kinda guy who’d know such things!

Ask and you shall receive Matt :) I use an application created by Unsanity called ClearDock. ClearDock is free, easy, and available as a universal binary. Once ClearDock is installed it’s somewhat hidden. You can find it in the System Preferences and then under Application Enhancer.

ClearDock Window

At first glance you’ll notice that there are a few options that you can set. If all you care about is a transparent dock background then uncheck the Re-Color The Dock Background check box. That will give you a nice transparent dock like this screenshot. The other features that ClearDock offers are changing the color of the dock’s background, the dock’s border, and the color of the running application’s triangles. With a hint of creativity you can come up with a wild scheme like this :)

Dock Preview

Hope this helped Matt!

13 Comments

Automatically Launch An Application At Startup

Right when I was sitting down at the computer trying to figure out what to write about a new comment was posted here on Keynote 2 Keynote. The comment from Dave included a question. What a coincidence, I needed something to write about and Dave provided me with an idea for a quick tutorial. Here’s Dave’s question.

Do you know a way to get transmission to automatically start up and download?

I’m guessing that you mean startup automatically when you boot up your Mac? If so you’re in luck Dave. Not only do I know how to automatically startup transmission, but the method will work for any application :)

The bread crumbs lead to the System Preferences and this is where you’ll begin your journey. Once you open the System Preferences you want to click on Accounts, it’s in the System category towards the bottom. Near the top of the Accounts window you’re looking for the button that says Login Items, click that. Note: This tutorial is for OS X 10.4.9, if you are using a previous version of OS X the Login Items may be located somewhere else.

Login Items Window

Once you make it to the Login Items window you want to click the + button that’s depicted in the screenshot above. The + button brings up a dialog box which allows you to select a program that you would like to launch at startup. Click Add once you’re finished. At this point you’re 99% finished. If you’d like the application that you are launching at startup to be hidden (ie using the Apple+H keystroke) by default then click the checkbox next to the item. This will keep you desktop nice and clutter free if you end up adding lots of Login Items. Wasn’t that fairly painless? You can now setup any program you’d like to launch when you boot up your mac using these simple instructions.

Now back to Dave’s original question. Transmission is designed to begin downloading as soon as the application is launched. So if you setup Transmission as a Launch Item your torrents should begin downloading as soon as you boot up your Mac!  I Hope this answered your question and maybe enlightened a few other readers as well :)

If anyone would like some further reading about Launch Items, MacFixIt.com has a pretty decent Q&A article about the subject.

Comments

Full Screen Quicktime Without QT Pro!

Quicktime IconIts getting late and I have to drive 400+ miles tomorrow so this’ll be a quickie :) After talking about trial software that comes with OS X I started thinking about Quicktime and what ‘going pro’ actually gets you. And to tell you the truth, I really had no clue what pro will give you other than being able to display videos in full screen. So I took a trip to Apple’s Quicktime Pro page to find out why I would want to ‘go pro’ and here’s the low down.

  • Gives the ability to watch movies full screen.
  • Pro allows you to save your favorite movie trailers on your computer.
  • Easily create slideshows with a soundtrack
  • Record video

Out of those 4 features the only one I could see myself doing on a regular basis is viewing video in full screen. So Quicktime Pro really isn’t for me. Not being able to watch Quicktime videos in full screen is sort of a bummer though. So I did a bit of digging around I found an easy workaround that scores big points in my book :)

Watching videos in full screen without Pro is actually quite easy with a simple AppleScript!

Quicktime Full Screen Script

If you’ve never used an apple script before here’s some basic instructions. Open up the Script Editor.app found in your Applications directory. Copy and paste the following code into the Script Editor.app window.

tell application "QuickTime Player"
        present front movie scale screen
end tell

Now click

File > Save As…

and save it as an Application.

Quicktime Full Screen Script Save As

You’re all set! Now anytime that you are watching a video with the Quicktime Player simply run this application that you’ve made and you’ll instantly be watching videos in full screen :)

This works on my machine with Quicktime 7.1.5, your results may vary with other versions.

Comments

Easily Sync NetNewsWire With NewsGator

NewsGator IconI’ve been using NetNewsWire for about 3 weeks now. I’m still enjoying the speed advantage that a desktop RSS reader gives you over its online brethren. However, I was recently at a friends house and got the itch to feed my RSS addiction but had no way to read my precious news! I still had my Google Reader account, but it was missing all the feeds that I subscribed to in the last 3 weeks, and worst of all the unread counts were through the roof :(

I have been putting off trying to get NetNewsWire to sync with NewsGator for quite a while now. Mainly because setting up syncing often turns into a headache. But, finally my addiction overcame me.

I was surprised at how simple setting this up turned out. In the matter of 5 minutes I was reading all my NetNewsWire subscriptions online with NewsGator.

NewsGator Signup

I started out by signing up for a free NewsGator account. This didn’t take long and was hassle free. Next I opened NetNewsWire and went to the Preferences ( Keystroke: Apple+, ). I selected the syncing page followed by the “Account ” button. I clicked the check box that says Sync using NewsGator and then entered my username and password that I signed up to NewsGator with. That’s it! I clicked the “Sync Now” button and was good to go.

NetNewsWire And NewsGator Sync Preferences

I’ve had about an hour or two experience with NewsGator and it seems to be working well so far. I’ve only thought of one feature that I’d like added to NewsGator (maybe its there, I just can’t find it). Normally I have NetNewsWire setup to sort my feeds by the unread item count. This is nowhere to be found in NewsGator :( Other than that I’m pretty impressed at how quick and easy it was to get this up and running. I can’t wait to give NewsGator a real test next time I venture off without my own computer.

NewsGator Preview

Comments

Ultimate GeekTool Setup - Pimp Your Desktop Part 2

Yesterday I wrote up a simple review of GeekTool. Today I’m going to show you how to take advantage of its power and build a clean, custom, functional GeekTool setup. Usually when you hear anything about GeekTool you see a desktop that looks similar to one of these. While these setups might be useful in some situations, they aren’t what I would consider pretty. Prepare to get your hands dirty, we’re playing with code! (ok, ok… it won’t be hard, I just had to psych you out!)

GeekTool Desktop Preview

Here’s a preview of what the following GeekTool scripts/commands will look like if you implement them all. Displayed in the screenshot is iTunes album art, iTunes track info, monthly calendar, internal ip addresses, external ip addresses, the wireless network you are connected to, time since you’ve restarted your computer, and cpu/memory statistics. You can easily pick and choose what info you’d like to display with GeekTool. Keep reading and I promise that you’ll want to use at least one of these GeekTool entires!

Before I start I’d like to thank everyone who’s code I’ve used. I’ve given you full credit by citing each script/command, if you are the author of a script and I mis-cited the source, let me know.

Monitor CPU/Memory Usage With Top

GeekTool Top Command Preview

Using the top command you can list processes that are currently using the CPU. You’ll need to use a few switches to get top to work with GeekTool, namely -l2. By modifying the cut at the end of the command you can choose which columns of information you’d like displayed. You can read more about how to edit those columns at the source link below. By inputting the following command into GeekTool as a shell entry you’ll see exactly what I have in the screenshot above.

GeekTool Shell Entry

top -ocpu -FR -l2 -n20 | grep '^....[1234567890] ' | grep -v ' 0.0% ..:' | cut -c 1-24,33-42,64-77

Source: VRic’s comment on MacOSXHints.com

Display You Computer’s Uptime And Total CPU/Memory Usage

GeekTool Uptime Command Preview

Unlike the PC world, you’re Mac may not be restarted for days or even weeks. Thats why I like the next command. It not only tells me how long its been since I restarted my MacBook Pro, but it also summarize my CPU/Memory usage. At a quick glance I can tell how much work my computer is doing. I edited the original command that I found to display the info on multiple lines so I could tuck it nicely along the left side of my screen.

GeekTool Shell Entry

uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 " " }'; top -l 1 | awk '/PhysMem/ {print "RAM : " $8 " "}' ; top -l 2 | awk '/CPU usage/ && NR > 5 {print $6, $7=":", $8, $9="user ", $10, $11="sys ", $12, $13}'

Source: MacGeekery.com

Current Wireless Network

GeekTool Wireless Network Command Preview

I found this neat script which displays the wireless network that your Airport is currently connected to and the channel it’s on. The one caveat of this script is that it only displays the first word of the access points name. Maybe someone can find a fix for this :) Make a new file, name it airpot.sh and copy the airport.sh code into that file. You’ll need to make sure that this file is set to be executable. At the terminal type: chmod 755 airport.sh . Then use the following command in GeekTool as a Shell Entry. Make sure you change the path in the shell entry to the location of your airport.sh file.

GeekTool Shell Entry

sh /Users/neyoung/bin/airport.sh

CODE - airport.sh

#!/bin/sh
myvar1=`system_profiler SPAirPortDataType | grep -e "Current Wireless Network:" | awk '{print $4}'`
myvar2=`system_profiler SPAirPortDataType | grep -e "Wireless Channel:" | awk '{print $3}'`

echo "Airport : $myvar1 - $myvar2"

Source: Yann Bizeul’s thread at Tynsoe.org

Ethernet And Airport IP Addresses

GeekTool Internal IP Address Command Preview

I don’t know about you, but I really like to be able to find out my IP address at a quick glance. The following script will show the IP addresses of your ethernet and airport interfaces. I edited this script so that the output will say INACTIVE if you aren’t using one of the two. You’ll need to create a new file named ipaddresses.bash and copy the contents of the script below into the file. Make sure that you set the script to be executable with chmod. Then make a shell entry in GeekTool to call the ipaddresses.bash script.

GeekTool Shell Entry

bash /Users/neyoung/bin/ipaddresses.bash

CODE - ipaddresses.bash

#! /bin/bash

myen0=`ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`

if [ "$myen0" != "" ]
then
    echo "Ethernet : $myen0"
else
    echo "Ethernet : INACTIVE"
fi

myen1=`ifconfig en1 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`

if [ "myen1" != "" ]
then
    echo "AirPort  : $myen1"
else
    echo "Airport  : INACTIVE"
fi

Source: Yann Bizeul’s thread at Tynsoe.org

External IP Address

GeekTook External IP Address Command Preview

Having the IP address of your ethernet/airport card might not always be enough. If you are behind a router or dsl/cable modem then you’ll also have an external IP address. If you’d like to easily find out what that address is use the following command as a GeekTool shell entry.

GeekTool Shell Entry

echo "External :" `curl --silent http://checkip.dyndns.org | awk '{print $6}' | cut -f 1 -d "<"`

Source: MacOSXHints.com

Calendar Of The Current Month

GeekTool Calendar Command Preview

I’m lazy, and if I can avoid opening the Dashboard or iCal I will :) Using the next command you can have a nice little monthly calendar placed right on your desktop. The current day will be denoted with double pound signs (ie. ##).

GeekTool Shell Entry

cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"

Source: TeutonicSpectator.com

Currently Playing Track In iTunes - Track, Artist, Album

GeekTool iTunes Track Info Command Preview

I use YouControl: Tunes to show me the track info and album art when a new song starts playing in iTunes. But YouControl: Tunes notifies me via an overlay and it won’t stay up there forever. So using the iTunesInfo.scpt applescript I can always look and see whats currently playing. Make a new file named iTunesInfo.scpt and put put all the iTunesInfo.scpt code into it. Then use the following shell entry to run with script in GeekTool.

GeekTool Shell Entry

osascript /Users/neyoung/Pictures/iTunes Artwork/iTunesInfo.scpt

CODE - iTunesInfo.scpt


tell application "System Events"
	set powerCheck to ((application processes whose (name is equal to "iTunes")) count)
	if powerCheck = 0 then
		return ""
	end if
end tell
tell application "iTunes"
	try
		set playerstate to (get player state)
	end try
	if playerstate = paused then
		set trackPaused to " (paused)"
	else
		set trackPaused to ""
	end if
	if playerstate = stopped then
		return "Stopped"
	end if
	set trackID to the current track
	set trackName to the name of trackID
	set artistName to the artist of trackID
	set albumName to the album of trackID
	set totalData to "Track  : " & trackName & trackPaused & "
Artist : " & artistName & "
Album  : " & albumName
	return totalData
end tell

Source: TeutonicSpectator.com

Currently Playing Track In iTunes - Album Art

GeekTool iTunes Album Art Command Preview

To display the current tracks album art you’ll need two GeekTool entires. The explanation to this can be found in the source link below. Basically the first script creates the album art image. The second entry displays the image. If the current track doesn’t have any album art or if iTunes isn’t running then nothing is displayed. You’ll notice that the album art or the track info from the previous script won’t change immediately when a new song starts to play. This is a downfall of GeekTool.

GeekTool Shell Entry

osascript /Users/neyoung/Pictures/iTunes Artwork/iTunesArtwork.scpt

GeekTool Picture Entry

file:///Users/neyoung/Pictures/iTunes%20Artwork/albumArt.tif

CODE - iTunesArtwork.scpt


(* Set Defaults and Loctions *)

set iTunesArtworkFolder to ((path to home folder) as text) & "Pictures:iTunes Artwork:"
-- Artwork Folder

set DefaultArtwork to ((path to home folder) as text) & "Pictures:iTunes Artwork:Default:albumArt.tif"
-- When there's no artwork or iTunes isn't running. This is a transparent TIFF.

set DefaultFolder to ((path to home folder) as text) & "Pictures:iTunes Artwork:Default:"
-- Default Folder

set FromiTunesFolder to ((path to home folder) as text) & "Pictures:iTunes Artwork:From iTunes:"
-- Where iTunes saves the Artwork

set ArtworkFromiTunes to FromiTunesFolder & "albumArt.pict" as file specification
-- The Artwork from iTunes

set AlbumArtwork to (path to home folder) & "Pictures:iTunes Artwork:albumArt.tif" as string
-- The Album Artwork

set UnixAlbumArtwork to the quoted form of POSIX path of AlbumArtwork
-- Unix path to the Album Artwork


(* Check if iTunes is running. *)

tell application "System Events"
	if exists process "iTunes" then
		try
			
			(* Get Artwork From iTunes *)
			tell application "iTunes"
				set aLibrary to name of current playlist -- Name of Current Playlist
				set aTrack to current track
				set aTrackArtwork to null
				
				(* Is there any Artwork? *)
				if (count of artwork of aTrack) ≥ 1 then
					set aTrackArtwork to data of artwork 1 of aTrack
					set fileRef to (open for access ArtworkFromiTunes with write permission)
					try
						set eof fileRef to 512
						write aTrackArtwork to fileRef starting at 513
						close access fileRef
					on error errorMsg
						try
							close access fileRef
						end try
						error errorMsg
					end try
					
					(* Convert to Tiff *)
					tell application "Finder" to set creator type of ArtworkFromiTunes to "????"
					
					tell application "Image Events"
						set theImage to open ArtworkFromiTunes
						save theImage as TIFF in iTunesArtworkFolder & "albumArt.tif" with replacing
					end tell
					
				else
					
					(* If there's no Artwork use the Blank Arwork. *)
					tell application "iTunes"
						if (count of artwork of aTrack) < 1 then
							set aTrackArtwork to DefaultArtwork
							
							
							set unixDefaultFolder to the quoted form of POSIX path of DefaultFolder
							set unixiTunesArtworkFolder to the quoted form of POSIX path of iTunesArtworkFolder
							
							do shell script "ditto -rsrc " & unixDefaultFolder & space & unixiTunesArtworkFolder
							
						end if
					end tell
				end if
			end tell
		end try
		
	else
		if (exists process "iTunes") is false then
			
			(* If itunes isn't running use the Blank Artwork *)
			tell application "Finder"
				set unixDefaultFolder to the quoted form of POSIX path of DefaultFolder
				set unixiTunesArtworkFolder to the quoted form of POSIX path of iTunesArtworkFolder
				
				do shell script "ditto -rsrc " & unixDefaultFolder & space & unixiTunesArtworkFolder
			end tell
			
		end if
	end if
end tell

Source: MacOSXHints.com

Final Notes

While working with GeekTool for the last few days here are some observations that I’ve made. GeekTool uses polling to check for updates to files/pictures/scripts. This has some drawbacks, one of which is high CPU usage if you set the refresh time to low for your entries. Normally 10 seconds works well. Another downfall of polling is that any output changes that a script generates won’t be updated till the GeekTool refreshes. By using events, GeekTool could use less CPU cycles and make updates to its display more timely. However, I don’t know if using events is even be possible with simple shell scripts.

I found one bug. Every once in a while my GeekTool entries overwrite each other. I think it’s just a display bug, because it was never permanent. If you close the GeekTool window and reopen it everything will be fine. I can’t figure out exactly how this happens, but it does time to time.

The GeekTool entries that I’ve illustrated in this article are by no means the only things that GeekTool can display. Remember, by using scripts and shell commands you can display just about anything! A few other things that people like to dispaly are hard disk statistics, a floating picture of your wife/kids/pet, or even a todo list.

The one thing that I’d really like to add to my GeekTool display setup would be current and average network traffic. I like to know when my internet connection is churning away so that if I’m not using it I investigate. A neat little graph would be cool :) But I’ve yet to run across anything to accomplish this.

I hope you’ve learned something by this article and that you’ll use some of the scripts/commands I’ve listed. I’ll make sure to make future post about other interesting things that I use GeekTool to display.

79 Comments

heat pumps and best buy pirodr! 666

Close
E-mail It
Socialized through Gregarious 39