When I’m writing, I like to listen to music in the background. When writing, I also like to have everything minimized so I can quickly grab a screenshot of the desktop where needed. This means that when I run into a track that doesn’t work with whatever I’m writing that I would need to unminimize iTunes, click the next button and then re-minimize iTunes. Awhile back I found a better way but can’t remember where for attribution. So, part of my default user template and imaging framework now includes setting the iTunes Dock icon to show the track that I’m playing so I can easily go to the next song, filing away the current song to remove from whatever playlist at a later date in case I’ve forgotten who the artist was. By default the iTunes Dock icon doesn’t show the current playing track. To tell it to:
defaults write com.apple.dock itunes-notifications -bool TRUE
Then killall Dock:
Now when you click on iTunes in the dock and hold the mouse down, you’ll see the following:
If you later decide you don’t like this:
defaults write com.apple.dock itunes-notifications -bool FALSE
And then killall Dock:
Using Mac OS X, one of the most trivial things (provided you have permission) is to add an object to the dock. Applications go on the left side of the dock and folders/documents/stacks go on the right. From the command line it isn’t quite as trivial but not that complicated either. To do so from the command line, you can write directly into the com.apple.dock.plist for a user. To do so, we’re going to use the defaults command and we’re going to look at adding an application first:
You can also add a custom title for the object that you are adding by using the file-label key and providing a string with the content that you want the label to have. You can also add a folder or file to the dock using a similar command:
You can also write an object using a variable, or another command when wrapped with “. For example, if we wanted to put a link to the specific users directory rather than the /Users directory we would use the following:
There are several uses for this. For example, you can link to certain folders that allow you to access recently changed content. Provided you have mounted a network share you can also add a network directory, similar to what happens when you add your Network Home in managed preferences. But this gets the process started and from here it’s just figuring out your specific logic. Once you have added an item into the Dock you’ll then need to restart it:
You should then see your Dock item. It is worth noting that if the location does not exist then you will need to create it and so you might script some logic as such. Also, if you create the location after creating the item then you will need to restart the Dock again.
You click on an icon in the dock that brings up a grid of the items in the list and then you click on one of the items in that list. But I like the way the rest of the dock operates, where I know what I’m moused over (is moused the verb of mousy?). And I sometimes click on the wrong one, which is why it’s nice to highlight one. To do so, run this command:
The Dock is, by default, anchored to the middle of the screen. However, in some environments you may want to have it skewed to one side of the screen. In order to do this Apple provides the ability to use pinning. Pinning will pin the dock to the start, end or middle; by default it’s pinned to the middle. If you pin the dock to the start and it’s either on the right or left side of the screen then it will appear to be skewed towards the top. If you pin it to the start and it’s on the bottom then it will skew to the left of the screen. In order to pin the dock to the start you can use the following command:
Once you’ve changed the pinning position you will not immediately see a change. First you need to kill the Dock. You can do this by rebooting or simply using the killall command using Dock as a pattern:
If you pin the dock to the end and it’s either on the right or left side of the screen then it will appear to be skewed towards the bottom of the screen. If you pin it to the end and it’s on the bottom then it will skew to the right of the screen. In order to pin the dock to the end you will use the following command:
defaults write com.apple.dock pinning -string end
To go back to the default settings, just pin the dock to the middle:
So I had a request that involved something I had never actually thought or bothered to do: customize the finder icon in the dock… I figured it would just be an image and therefore that it couldn’t actually be that difficult. And I was correct. Remarkably, the icon is actually called finder.png (you may have noticed that smaller iPhone and OS X images are almost always png files these days):
Then I restarted the Finder. Well, no love – the icon didn’t replace the one in my dock. So I restarted my dock. Still no love. So I restarted my computer. Viola, as you can see below, it worked like a charm!
Next, I decided to start looking at what else I could do in here. First, the background of the dock. There are scurve-m.png, scurve-sm.png, scruve-xl.png and scurve-l.png. As you resize your dock it will replace these pictures as needed. So, if you take one, edit it (in this case I made mine black with 10% transparency) then it will change the color of the dock next time you restart, or use the following command:
Additionally, there’s the trash icons trashempty.png and trashfull.png and the Dashboard.png files. You’ll also notice some files starting with the word indicator – these are the little lights that appear under an icon when the application that the icon represents is open. I think these are perfect as-is, so I didn’t bother to customize them. There’s also a bunch of other images in here, like the ones that create the background you see when you hover over an icon and the ones that generate the QuickLook views.
Finally, I was going to make a little application to allow you to change all this stuff around. But, it turns out that the uber-smart cats at Panic (makers of Transmit) beat me to the punch with Candy Bar.
Using Open Directory you can push out a key to stop the automatic Spaces switch when a different application in a different Space steals focus. To do so, first open Workgroup Manager and click on the group in question. Then click on Preferences and then the Details tab. Next, click on the + sign and browse to /System/Library/CoreServices/Dock.app. Next click on Dock and click on the pencil. Here drop down the Often disclosure triangle and click on the New Key button. From here, name the key workspaces-auto-swoosh and set the Type to Boolean and the Value to True.