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: defaults write com.apple.dock persistent-apps -array-add ‘<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Microsoft Office 2008/Microsoft Word</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>’ You can also add a custom title for the object that you are adding…
-
-
Last of the Screen Sharing Hacks
Once upon a time (all the way back in Mac OS X 10.5) you could add a bunch of useful icons into the toolbar of Screen Sharing.app using: defaults write com.apple.ScreenSharing ‘NSToolbar Configuration ControlToolbar’ -dict-add ‘TB Item Identifiers”(Scale,Control,Share,Curtain,Capture,FullScreen,GetClipboard,Quaty)’ But alas, you can’t any more (NSToolbar still exists but I haven’t found a way to get the array to result in actual icons in the toolbar). I’ve done a few articles for other preferences so I thought I’d dig my heels in and see if there were any I missed (using gdb). Well, apparently, there’s still ShowBonjourBrowser_Debug, which was also in 10.5 but it doesn’t seem to do anything. But I…
-
Spotlightish Finder
When you search for files the Finder window with the results has what is known as the Path Bar. As you can see in the below image, the Path Bar allows you to click on any directory in the hierarchy up to the one you are on and open that directory in the Finder. By default, the Path Bar is only shown in a search result, but if you like it then you can see it in every Finder window. To enable this feature, create a boolean key in the com.apple.finder.plist with a value of yes. To do so, you can use the defaults command: defaults write com.apple.finder ShowPathBar -bool…
-
Command Keys and ScreenSharing
I like to send the command, control and other system keys to hosts that I’m using ScreenSharing or Remote Desktop to access. But as I recently discovered, not everyone does. You can turn this feature off using the defaults command to augment the DoNotSendSystemKeys key of the com.apple.ScreenSharing.plist property list file. Simply run the following command: defaults write com.apple.ScreenSharing DoNotSendSystemKeys -bool YES To turn them back on: defaults write com.apple.ScreenSharing DoNotSendSystemKeys -bool NO Or for Remote Desktop, augment the com.apple. defaults write com.apple.RemoteDesktop DoNotSendSystemKeys -bool YES To turn it back off for Remote Desktop: defaults write com.apple.RemoteDesktop DoNotSendSystemKeys -bool NO FYI, if you don’t want to send the command keys…
-
Speed Up ScreenSharing
Screen Sharing over a WAN can be a bit slow. But you can send less data and receive a less latent connection. To do so, you are going to augment the controlObserveQuality key of the com.apple.ScreenSharing.plist property list. If you set the key to a 1, which I see commonly suggested then it will be black and white, which in todays world is another way of saying practically illegible. Instead try the number 2, which sets it to grey scale, which is pretty good (that’s what I use). To do so run: defaults write com.apple.ScreenSharing controlObserveQuality 2 You can also set the controlObserveQuality key to 3, 4 or 5 which…
-
Programmatically Changing the Mac OS X Browser
I am starting to get a lot questions on how to change the default browser for Mac OS X. I don’t know if it’s in preparation for summer imaging or if it’s because people clicked the button to reset their default browser to Chrome and then realized that, while fast, it just isn’t Safari. Either way, the default browser is stored in the com.apple.LaunchServices.plist, inside the LSHandlers array. Now, changing this with a defaults command would involve copying all the information into said command and then dumping it back in after changing all entries of com.apple.safari to the information for the browser you actually want to use. If you do…
-
Quick Looks X-ray Mode
You can make icons semi-transparent in Quick Look, with previews of the folder’s contents in the folder. defaults write com.apple.finder QLEnableXRayFolders 1 Once run, and the Finder is killed (or a reboot performed), Quick Look ends up looking something like this: To undo it, simply change the 1 to a 0 from earlier: defaults write com.apple.finder QLEnableXRayFolders 0
-
Mac: Setting Screen Saver from the CLI
Earlier today I posted on how to activate the screen saver from the command line. But I hadn’t yet mentioned how to set it up. Before I do, let’s look at the /System/Library/Screen Savers directory. Here you should see a number of bundles, such as RSS Visualizer.qtz, Paper Shadow.slideSaver, Flurry.saver, Arabesque.qtz and any third party screen savers you may have installed. These are the paths to your screen savers. In order to set which screen saver you would like to use from the command line, you’re going to use the defaults command along with the com.apple.screensaver domain. First let’s read the settings there: defaults -currentHost read com.apple.screensaver Which will provide…
-
Managing SMB Using Defaults
One of the biggest issues that a number of large environments have is controlling what client systems are able to see on a network. In these types of environments, limiting the number of Windows file servers that show up can be a show stopper. So Apple has given us an option in the com.apple.smb.server.plist file for RegisterWINSName. By default it isn’t there, but when you use the following command and then restart smb it will suppress your system from the list of servers: defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server RegisterWINSName -bool false You can also use com.apple.smb.server to change the NetBIOS name and server description.
-
April Fools – Trash Rather than Cut
You can set the cut function of the Finder to move items into the trash rather than into the clipboard: defaults write com.apple.Finder AllowCutForItems true It’s not the nicest of jokes to play on people though… So to undo it: defaults write com.apple.Finder AllowCutForItems false Happy April Fools Day