Mac OS X (Tiger and Leopard) Configuration Tips


Note: I add items to this list when I discover configuration tips that I personally find useful. It is not meant to be a comprehensive list of everything you can do to customize OS X; it is mainly a record so I remember what customizations I've performed, so I can potentially undo them later and/or repeat them on new computers or after major OS upgrades. Good resources for more Mac OS X configuration tips are macosxhints, lifehacker, secrets, and (somewhat less frequently) the official Apple Support site – most of the tips I've listed here were either found at one of those sites initially or have ended up archived there later.


My current operating system is Mac OS X 10.5.7 (Leopard) with (Apple standard) X11/Xquartz 2.1.6


Here are the steps I follow to configure a new Mac.


Want to Twitter this URL? Use http://tinyurl.com/dwhmacosx


Contents:



Recover when X11 freezes while scrolling


Problem: When using an xterm or other X11 program (e.g., vim), aggressive (i.e., rapid and/or continuous) scrolling with the middle mouse wheel can cause X11 to freeze. This is a known bug in the Apple X11 software.

Solution 1:

  1. Start the Terminal application and issue the command:   killall -STOP X11

  2. Use the mouse to move the cursor into any open X11 window, and click to select. Note that this will not produce any noticeable effect (except possibly the spinning color wheel).

  3. Return the cursor to the Terminal window, and issue the command:   killall -CONT X11

  4. This process has the disadvantageous side effect that if you are using a third-party virtual desktop manager, then all existing X11 windows will be gathered onto the current desktop.

Solution 2:
  1. Start the Activity Monitor application, and open the main activity monitor window if it does not open by default (Cmd-1 or Window→Activity Monitor).

  2. Select the X11 task in the activity monitor window, then run the View→Sample Process function. You might need to repeat the Sample Process function several times.

Solution 3: If all else fails, then select Apple→Force Quit, and kill the X11 program. WARNING: this will lose changes to any unsaved files.

OS Version Compatibility: Tiger; untested in Leopard, but probably works. It's possible that this issue was fixed in 10.4.3+ and/or that it only occurs when using a Logitech USB mouse. During several years of running 10.5+, this issue has not reoccurred.


Change the default login shell


Problem: The “factory set” default login shell for Mac OS X (Panther+) is bash. Some (misguided!) users may wish to use other shells (e.g., tcsh is popular).

Tiger Solution: To change the default shell for a particular user account, use the application utility Netinfo Manager. Under the “users” category in Netinfo Manager, look for the desired login name and find the “shell” item in the list of properties for that account. This should say /bin/bash by default; modify it to the desired shell (e.g., /bin/tcsh). This will require first unlocking the properties by clicking on the lock icon and entering an administrator-level password. Quit Netinfo Manager, then log out of the user account and log back in to globally initialize the new default shell.

Leopard Solution: The application utility Netinfo Manager no longer exists in Leopard. Instead, open the Accounts preferences in System Preferences. Unlock the preferences by clicking on the lock icon in the lower left corner of the preferences panel and entering an administrator-level password. Then right-click (or control-click) on a user name and select the Advanced Options menu. Select the desired login shell from the pull-down menu, and click on OK. Log out and back in to put the change into effect.

A. Lorber pointed out to me that in order to change the default login shell, your chosen shell must also be listed in the file /etc/shells, which OS X consults to determine what is a valid shell. By default, /etc/shells contains the following entries:

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh


If you want to use a different shell from these as your default login shell, then you must edit /etc/shells to include the full path to the installation of the shell on your computer (e.g., /opt/local/bin/bash). Editing /etc/shells requires an administrator-level password.

OS Version Compatibility: Tiger and Leopard, with different procedures (see above).


Set iChat to automatically accept incoming video invitations


Problem: You want iChat to automatically accept any incoming video chat invitation. This can be useful for keeping an eye on things at home when you are away (what are my cats doing right now?) or to help out less technologically savvy people (e.g., grandma). In AIM, this is a standard preferences settings, but in iChat it does not show up in the Preferences menu.

Solution: This does exist as an iChat preferences setting, but it is a hidden preference. Issue the following command in a Terminal or xterm (X11) window:

defaults write com.apple.ichat AutoAcceptVCInvitations 1

Repeat with “1” replaced by “0” to turn it off. The file modified by defaults in this case is ~/Library/Preferences/com.apple.iChat.

OS Version Compatibility: Tiger; untested in Leopard, but probably works.


Make focus follow mouse in Terminal


Problem: By default, mouse focus for Terminal is determined by clicking on the desired window, but it is often more convenient to have the focus automatically follow the mouse to any window.

Solution: Issue the following command in a Terminal window and then restart Terminal:

defaults write com.apple.terminal FocusFollowsMouse -string YES

Repeat with “YES” replaced by “NO” to turn it off. The file modified by defaults in this case is ~/Library/Preferences/com.apple.Terminal.plist.

OS Version Compatibility: Tiger and Leopard.


Make focus follow mouse in X11 (using quartz-wm)


Problem: By default, mouse focus in X11 is determined by clicking on the desired window, but it is often more convenient to have the focus automatically follow the mouse to any window.

Solution: Issue the following command in an xterm (X11) window and then restart X11:

defaults write com.apple.x11 wm_ffm -bool true

Starting with Leopard 10.5.5 (which upgraded X11 to 2.1.5), this is changed to:

defaults write org.x.X11 wm_ffm -bool true

Repeat with “true” replaced by “false” to turn it off. The file modified by defaults in this case is ~/Library/Preferences/com.apple.x11.plist. ~/Library/Preferences/org.x.X11.plist.

OS Version Compatibility: Tiger and Leopard.


Enable click-through in X11 (using quartz-wm)


Problem: Clicking on an unfocused X11 window (if you have not enabled "focus follows mouse") or clicking on an X11 window when X11 is in the background will only focus the X11 window in the case of a left click. However, any additional action implied by a click (e.g., using a middle click to paste text selected in another X11 window - if focus follows mouse is not enabled - or selected and copied in a non-X11 window) will not be performed and the click will not activate the window.

Solution: Issue the following command in an xterm (X11) window and then restart X11:

defaults write com.apple.x11 wm_click_through -bool true

Starting with Leopard 10.5.5 (which upgraded X11 to 2.1.5), this is changed to:

defaults write org.x.X11 wm_click_through -bool true

This feature allows the action implied by the click to be passed through to the application.

Repeat with “true” replaced by “false” to turn it off. The file modified by defaults in this case is ~/Library/Preferences/com.apple.x11.plist. ~/Library/Preferences/org.x.X11.plist.

Note that focusing or activation of the X11 window will only happen if the click would normally have focused or activated the window. For example, a left-click (or equivalent) will normally activate an X11 xterm window, whereas a middle click (or equivalent) will not. However, with click-through enabled, a middle click on an unfocused or backgrounded (i.e., inactive) X11 xterm window will perform the expected action of pasting whatever is in the copy buffer into the xterm window, but will not activate it (i.e., will neither focus the xterm window nor bring X11 to the foreground).

The following odd behavior with click-through in X11 appears to be fixed as of Leopard 10.5.5 with X11 2.1.5

Some confusing click-through behavior found in Leopard 10.5.4 with (Apple standard) X11 2.1.1: A click-through event cannot constitute the very first command issued into an xterm window whose initiation started X11. You must at least once manually click to activate the xterm window (or any other X11 window currently running) before click-through will subsequently be enabled. For example, if you type "xterm" in a Terminal window to start X11 and instantiate an xterm window, then immediately click back onto the Terminal window, highlight the text "xterm" using the left mouse button (or equivalent), then try to click-through paste it into the xterm window using the middle mouse button (or equivalent), then nothing will happen. However, if after starting X11 and the xterm window, you click on a non-X11 window (like a Terminal window) to put X11 in the background, then click on the xterm window to put X11 in the foreground, then again click to a non-X11 window (like a Terminal window) to put X11 in the background, then any subsequent click-through paste will transfer the contents of the copy buffer into the xterm window command line as expected.


OS Version Compatibility: Tiger and Leopard.


Configure a large xterm window in X11


Problem: The default xterm window in X11 is small with a very tiny font.

Solution: Use the following command from the X11 Applications menu or the command line:

xterm -fn 10x20 -geometry 80x21 -sb -sl 1500 -vb -bg white

OS Version Compatibility: Tiger and Leopard.


Change the highlight color in Preview


Problem: The highlight color in the Preview application is difficult to see; also, search terms don't appear to be highlighted in the viewed document.

Solution: Issue the following command in an xterm (X11) or Terminal window and then restart Preview:

defaults write com.apple.Preview AppleHighlightColor "0.9137 0.7216 1.0"

The three numbers range from 0.0–1.0. The values shown here produce light purple. To find the values for a particular color, set the system-wide highlight color using the Appearances panel in System Preferences, then view the AppleHighlightColor setting in ~/Library/Preferences/.GlobalPreferences.plist.

After executing a search in Preview, press Tab to shift the focus into the main window and highlight the search term with the selected color. Then press Cmd-G to jump forward through selected search terms using the selected highlight color.

OS Version Compatibility: Tiger and Leopard.


Run the Mac OS X maintenance scripts


Problem: Mac OS X is a UNIX-based system, built specifically on FreeBSD. UNIX systems run scheduled maintenance routines to clean up a variety of System logs and temporary files. By default, these are executed between 03:15 and 05:30 local time, depending on the script. If your Mac is shut down or in sleep mode during these hours, the maintenance scripts will not run. This results in log files that will grow over time, consuming free space on your Mac OS X startup disk. If your Mac is shut down or left in sleep mode overnight, you should invoke these maintenance routines manually on a regular basis.


Solution: Manually running the maintenance scripts – Using an administrator-level account, you can execute all three maintenance scripts at once by issuing the following command in a Terminal or xterm (X11) window.

sudo periodic daily weekly monthly

All three scripts will run in sequence. There is no visual feedback while the scripts execute.


Determining when the maintenance scripts last ran – You can check the date and time stamps of the log files associated with each maintenance script, which indicates when the scripts were last executed. Use the command

ls -al /var/log/*.out

The maintenance performed by the scripts – Each maintenance script has a specific function.

  • The daily script removes old log files, “scratch” and “junk” files, backs-up the NetInfo database, reports a variety of system and network statistics, and rotates the system.log file. Under Tiger, the daily script also cleans up scratch fax files and prunes asl.log, the log for the new Apple System Logging facility.

  • The weekly script rebuilds the locate and whatis databases and rotates the following log files: ftp.log, lookupd.log, lpr.log, mail.log, netinfo.log, ipfw.log, ppp.log, and secure.log.

  • The monthly script reports per-user usage accounting and rotates the wtmp, install.log, and cu.modem.log files.

OS Version Compatibility: Tiger and Leopard.


Fix garbled fonts


Problem: Fonts in PDF or postscript files appear fine on screen, but are garbled when printed.


Solution:

  1. Close all applications

  2. Delete the /Library/Caches/com.apple.ATS folder

  3. Immediately restart the computer

This removes system font cache files that can become corrupted.

OS Version Compatibility: Tiger; untested in Leopard, but probably works.


Set view options for the Desktop


Problem: The Desktop can become crowded with icons. Which one is a PDF file? Which one is an image? Where's that file I just downloaded? I don't know! Help me!

Solution: Right-click (or control-click) in the Desktop background, then select Show View Options. The options for Show Icon Preview and Keep Arranged By Kind are especially useful.

OS Version Compatibility: Tiger and Leopard.


Rotate individual PDF pages in Preview


Problem: Some PDF files contain a mix of portrait and landscape pages. Preview contains obvious functions (Rotate Left or Rotate Right in the Tools menu or on the toolbar) that will rotate all of the pages from one format to the other, but how can you rotate only certain pages?

Solution: Hold down the option key before selecting Rotate Left or Rotate Right to rotate only the current page. If you save the document after applying the selective rotations, it will also save the rotations.

OS Version Compatibility: Tiger and Leopard.


Use cron to schedule automatic tasks


Problem: How can I schedule some tasks (like backing up one disk to another) to occur automatically on a regular basis?

Solution: The standard UNIX command cron will manage the execution of tasks on a specified schedule. The first step is to create a command-shell script that executes the desired task. For example, I use a bash script containing an rsync command that backs up the contents of my main hard drive to a secondary hard drive. Store this shell script somewhere in your home directory (the home directory on a Mac is at /Users/{login name}); for example, I want this script to be executed daily, so I created a hidden sub-directory in my home directory called .cron.daily/ and put the script file in it.

Tasks for cron to execute are listed in a crontab file. System-wide (i.e., root level) cron tasks are controlled by /etc/crontab, but for user-level tasks, a crontab file (or, in my case, a hidden .crontab file) can be created in the home directory. The format of the crontab file is like this:

#minute hour mday month wday command
 1503***sh /Users/{login name}/.cron.daily/backup.sh
 15031**sh /Users/{login name}/sample1.sh
 1503**6sh /Users/{login name}/sample2.sh
 */15****sh /Users/{login name}/sample3.sh

The first line of the crontab file is a commented header line (indicated by a leading #). The specified tasks begin on the second line. Entries in columns are separated by tabs. In this example, the command in the first task line (to execute my disk backup script) is executed at 03:15 (i.e., 15 minutes after 3am) on every day of the week (wday) for every day (mday) of every month (month). The asterisks are read as “every”. As further examples, the second task line would execute its command at 03:15 only on the 1st day of every month. The third task line would execute its command at 03:15 on the 6th day of every week. The fourth task line would execute its command every 15 minutes.

Allowed values for the crontab parameters are 0–59 for minute, 0–23 for hour, 1–31 for mday, 1–12 for month, and 0–7 for wday (0 and 7 are Sunday). The month and wday values can also be specified using the first three letters of the month or day name (e.g., “Jan” for January or “Thu” for Thursday). Ranges and (comma-separated) lists are allowed. For example, 8–11 in the hours column would run the associated command at hours 8, 9, 10, and 11. A list of 1,2,5,9 in the hours column would run the associated command at hours 1, 2, 5, and 9.

Once the crontab file and the associated script file(s) have been created and stored in the specified locations, you must initiate the cron process by issuing the command

crontab /Users/{login name}/.crontab

(substitute your own name for your crontab file). The command

crontab -r

will stop the execution of cron tasks. The command

crontab -l

will list all of the currently scheduled cron tasks. I have found that cron will occasionally stop on its own (possibly associated with incremental software updates to the operating system), so it is a good idea to run crontab -l occasionally to make sure that your cron tasks are still running.

OS Version Compatibility: Tiger and Leopard.


Change the default web browser


Problem: I don't want to use Safari as my default web browser (e.g., for downloading URL-linked attachments in emails). How can I change the default web browser?

Solution: Start Safari. Type Cmd-, or select Safari→Preferences. In the Preferences window, select the General tab, then find and select the desired web browser under the Default Web Browser pull-down menu. This will change the default web browser for all applications.

OS Version Compatibility: Tiger and Leopard.


Make printers exit after finishing


Problem: Under Tiger (and earlier versions), when a print job finished, the printer utility would automatically quit and the associated icon would vanish from the Dock. Under Leopard, the default behavior is for the printer utility to remain active, with its icon in the Dock. How can I make the Leopard printer utility quit when it is done printing?

Solution: Right-click (or control-click) on the printer icon in the Dock and select “Auto-quit when done” to restore Tiger-like behavior. This apparently only needs to be done once, even if you have multiple printers installed.

OS Version Compatibility: Leopard only.


Change Dock appearance


Problem: Aaaargh! I hate the transparent, 3-D, glossy Dock in Leopard! What can I do?

Solution: Issue the following command in a Terminal or xterm (X11) window:

defaults write com.apple.dock no-glass -boolean YES

Restart the Dock using the following command:

killall Dock

This will convert the Dock appearance to something similar to the Tiger version (i.e., still transparent, but 2-D with no reflections). This is the same appearance that the Dock has by default in Leopard when it is configured in the Dock System Preferences to appear on the side of the screen instead of the bottom.

Repeat with “YES” replaced by “NO” to restore the “fancy” Leopard dock appearance. The file modified by defaults in this case is ~/Library/Preferences/com.apple.dock.plist.

OS Version Compatibility: Leopard only.


Use Front Row without an Apple remote


Problem: Wow! Front Row is really cool! I can hardly wait to look at all of the files on my computer by flipping through a rotating display of album covers, photo thumbnails, etc. But, alas! My Mac did not come with an Apple Remote! Can I still Use Front Row?

Solution: Yes, you can. Press Cmd-Esc to start Front Row. Navigate up and down with the arrow keys, select a menu item with the Enter key, go back one menu level with the Esc key. Press Cmd-Esc again to completely exit Front Row. If Front Row freezes, press Cmd-Option-Esc.

OS Version Compatibility: Leopard only.


Show full directory path in Finder windows


Problem: By default in Leopard, the title in a Finder window is set to the currently viewed folder. How can I make the title be the full directory path to that folder (i.e., similar to what would be returned by the Unix pwd command)?

Solution: Issue the following command in a Terminal or xterm (X11) window:

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

Relaunch Finder (e.g., select Apple→Force Quit) to put the change into effect. Repeat with “YES” replaced by “NO” to restore the default titles. The file modified by defaults in this case is ~/Library/Preferences/com.apple.finder.plist.

OS Version Compatibility: Leopard only.


Stop auto-switching in Spaces


Problem: Spaces is great and all, but it forces me to sort by applications instead of tasks. For example, if I select {application} from the Dock, then it automatically switches me to the virtual desktop space in which I first started {application}. However, what I really wanted was to start another instance of {application} running in my current virtual desktop space. Assigning {application} to all desktops in the Spaces preferences isn't the solution, because then Spaces just drags around all {application} windows onto all desktop spaces.

Solution: Issue the following command in a Terminal or xterm (X11) window:

defaults write com.apple.dock workspaces-auto-swoosh -bool NO

Restart the Dock using the following command:

killall Dock

Spaces will now allow you to start multiple instances of an application in separate desktop spaces. Note that implementing this setting can result in confusing behavior if you have used the Spaces preferences to assign a specific application to a specific desktop spaces (although assigning applications to all desktop spaces appears to be fine). Repeat with “NO” replaced by “YES” to restore the default behavior. The file modified by defaults in this case is ~/Library/Preferences/com.apple.Dock.plist.

OS Version Compatibility: Leopard (10.5.2+) only.


Disable starting an initial xterm when X11 is started


Problem: Leopard's implementation of X11 is not intended to be started from the Applications/Utilities folder (as it was in Tiger). Instead, X11 is automatically started on demand when an X application is started. X11 can still be started by itself by double-clicking on the X11 icon in the Applications/Utilities folder, but this will also automatically start an xterm. Under Leopard, there is no system xinitrc file that can be edited to disable starting that initial xterm. Please make it stop!

Solution: It's not entirely true that there is no longer a system-wide xinitrc file; it has just moved to /usr/X11/lib/X11/xinit/xinitrc.

Alternatively, issue the following command in a Terminal or xterm (X11) window:

defaults write org.x.X11 app_to_run /usr/bin/true

The true routine (intentionally) does nothing (no, really, just type man true and see for yourself). Repeat with “/usr/bin/true” replaced by “xterm” to restore the default behavior. The file modified by defaults in this case is ~/Library/Preferences/org.x.X11.plist.

(Note: Because of the new way that Leopard handles X11 compared to Tiger, you should also not configure X11 to start automatically at login, nor include it as a launcher in your Dock. Starting X11 in either of these ways will result in multiple copies of X11 running. You should also not start X11 manually - as described here - if it has already been automatically launched by Leopard.)

OS Version Compatibility: Leopard only.


Stop asking for confirmation before opening a downloaded file


Problem: Leopard tags files downloaded from the web, and asks for confirmation before running a downloaded application or script. While this does provide a default layer of security against running downloaded programs, it is also annoying for people who already exercise an appropriate level of caution about trusting downloaded software. (Note that this feature of Leopard does not do anything with regard to checking downloaded files for viruses, preventing malicious software from running, etc. – all it does is remind you that it was downloaded - and require an extra button-click - before the application or script can start). How can I disable this behavior?

Solution: (updated on 06/29/09) Since (approximately) Leopard 10.5.5, I have no longer noticed the really annoying aspect of this feature; namely, that it asked for confirmation every time any given application or file that was downloaded from the web was subsequently opened. Now, it seems to ask only the first time the application or file is opened, which is much more sensible and less annoying. Consequently, I have stopped trying to circumvent this behavior. The previously suggested procedure for dealing with this feature is now unnecessary to all but the most easily annoyed, and likely more effort than it is worth, but is preserved below as a historical record.

OS Version Compatibility: Leopard (10.5.5+) only.

THIS DESCRIPTION APPLIES ONLY TO LEOPARD VERSIONS BEFORE 10.5.5

This one is a little complicated, and a good explanation (with step by step instructions and screen-grabs) is available at http://henrik.nyh.se/2007/10/lift-the-leopard-download-quarantine. In the event that site becomes unavailable, I have reproduced the minimum necessary steps here.

First, save this file into your ~/Library/Scripts/Folder Action Scripts/ folder: Unquarantine.scpt. If that folder does not exist, then create it using the Terminal or xterm (X11) command:

mkdir -p ~/Library/Scripts/Folder\ Action\ Scripts

In a Finder window, navigate to (but not into) the folder that receives web downloads (e.g., this is set to ~/Downloads by default in Leopard). Right-click on the folder icon and select More→Configure Folder Actions.... Check Enable Folder Actions. If you had to create the ~/Library/Scripts/Folder Action Scripts folder, then you will also have to add it to the Folders with Actions column, by clicking on the + button next to the Show Folder button, then navigate to, and select, the ~/Library/Scripts/Folder Action Scripts folder. Finally, attach the Unquarantine action to the folder.

This folder action script runs the command:

xattr -d com.apple.quarantine "downloaded_file.zip"

The process described here will apply the Unquaratine script to only one folder. If you download files to other folders, then you will have to apply the script to those folders also for it to take effect.



Why doesn't does X11 work right with Spaces?


The text shown in the box below is preserved as a historical record. The problem of Spaces losing track of which desktop a particular X11 window is located on appears to be fixed in Leopard 10.5.5, which upgraded the Apple standard X11 to 2.1.5. The odd behavior noted below regarding which preferences file is used for X11 in Leopard 10.5.4 now makes more sense as a transitional problem, since, with the update to 2.1.5, Apple's X11 appears to be conforming more to the Xquartz version, which uses the org.x.X11.plist preferences file (e.g., see the discussions of focus and click-through behavior under Leopard 10.5.5).

OS Version Compatibility: Leopard (10.5.5+) only.

THIS DESCRIPTION APPLIES ONLY TO LEOPARD VERSIONS BEFORE 10.5.5

Problem: When multiple X11 windows (e.g., many xterm windows) are open on different Spaces workspaces, clicking on one of the windows or putting the cursor in the window (if "focus follows mouse" is enabled for X11) does not always activate the window.

Solution: This is a known problem with the current implementation of X11 (as of this writing, OS X 10.5.4 and X11 2.1.1), which causes X11 to become confused about where windows are located when they exist on more than one Spaces workspace. The problem is that X11 treats all windows as though they exist on the same workspace; consequently, if you are trying to activate an X11 window on one workspace that is “behind” an X11 window on a different workspace, then you will actually activate the X11 window that is “in front” on the other workspace.

Starting with Leopard, Apple is using a somewhat modified version of the Xquartz open-source implementation of X11 in OS X. The Xquartz project claims to have fixed this problem as of their version 2.2; however, as of Apple's version 2.1.1 this has not yet been implemented for Leopard. See the Xquartz project web site for more information.

For now, there are two solutions to this problem, neither of which is particularly satisfying:

  1. Wait for Apple to implement the fix in a future update of Leopard or X11.

  2. Trash the Apple installation of X11 on your computer and replace it with the current version of Xquartz X11. Instructions for doing this are available from the Xquartz project web site. Note that this is not for the faint of heart. Consequences include: the OS X Software Update will no longer deliver updates to X11 (updating the Xquartz X11 requires installing updated packages from their web site), future Apple updates could disable the Xquartz X11 (requiring re-installation of the Xquartz software), names of preference files associated with X11 will change, and so on.

Odd behavior of X11 (Apple standard 2.1.1 with Leopard 10.5.4): The org.x.x11 preferences file, although ostensibly not used by Apple's standard X11 (but used by, for example, the non-standard Xquartz version of X11), appears to be created when X11 starts (if it does not exist). In addition, starting X11 with an existing version of both com.apple.x11 and org.x.x11 will sometimes use org.x.x11 as the preferences file, which usually results in your preferences (like customized items in the Applications menu), which are probably stored in the com.apple.x11 file, not being implemented. I have found that copying ~/Library/Preferences/com.apple.x11 to ~/Library/Preferences/org.x.x11 after you set up your preferences in X11 will prevent the creation of a default org.x.x11 file, and will guarantee that things like customized menu items show up regardless of which preferences file is used by X11.



Time Machine is stuck on “Preparing Backup”


Problem: Normally it only takes a few minutes for Time Machine to complete its hourly backup, but now it seems like it's taking forever. I've waited N minutes before stopping it (where N > a few minutes), tried rebooting, cycling power on Time Machine, etc, but it still gets stuck on “Preparing Backup...”.

Solution: Fortunately, the solution to this problem is usually... patience. Certain events can cause Time Machine to lose track of which files it needs to backup, which necessitates performing a full comparison of your current hard drive contents to the contents of the last backup. This can cause the backup preparation stage to last for several tens of minutes to more than an hour, depending on the size of the drive you are backing up.

Events that can cause this problem include (a) the last Time Machine backup was interrupted (other than by issuing the Stop Backing Up command from the Time Machine toolbar menu), (b) your Mac was not shut down properly, (c) a mounted disk was not removed properly by ejecting it first, (d) a software update was installed (the Leopard 10.5.2 update was notorious for causing this problem), and (e) your computer was used for several days without performing a Time Machine backup (e.g., by not having the Time Machine disk connected or having backups turned off in the Time Machine preferences).

You can confirm that this is the origin of your problem with Time Machine as follows: after Time Machine starts (while it is “Preparing Backup”), open Console (from the Applications/Utilities folder) and select File→Open System Log. Near the bottom of the system log, there should be one or more time-tagged entries relating to the ongoing Time Machine process. If one of these mentions a (somewhat ominously named) “deep traversal”, then just be patient, let Time Machine do its thing, and all will be well in the future.

OS Version Compatibility: Leopard only.


Copy and paste between X11 and Mac OS


Problem: I often need to copy and paste text between X11 windows (e.g., xterm, gvim) and native Mac OS windows (e.g., Terminal, Firefox, Safari). This often results in undesirable results. How do I successfully (and reliably) copy and paste between these different flavors of windows?

Solution: Follow the instructions below to copy from one flavor of window and paste into another. Note that gvim and other X11 windows behave differently, but all Mac OS windows behave like Terminal. Some of these instructions require that you have click-through enabled in X11 and all of them assume that you are using a three-button mouse or the corresponding keyboard equivalents for a single-button mouse. The latter, in turn, requires that in the Input panel of the X11.app preferences, you have selected “Emulate three button mouse” and “Enable key equivalents under X11”.

  • gvim (X11) to xterm (X11): Select text in gvim window using left mouse button; press Ctrl-C to copy; move cursor to xterm window; middle-click to paste.

  • xterm (X11) to gvim (X11): Select text in xterm window using left mouse button to copy; move cursor to gvim window; press i, I, a, or A to enter gvim's editing mode; middle-click to paste.

  • xterm (X11) to Terminal (Mac OS): Select text in xterm window using left mouse button; press Cmd-C to copy; move cursor to Terminal window and left-click to raise it; press Cmd-V to paste.

  • Terminal (Mac OS) to xterm (X11): Select text in Terminal window using left mouse button; press Cmd-C to copy; move cursor to xterm window and left-click to raise it; middle-click to paste.

  • gvim (X11) to Terminal (Mac OS): This one is tricky! Select text in gvim window using left mouse button; press Ctrl-C to copy into gvim's buffer; immediately press Cmd-C to copy gvim's buffer into the X11 buffer; move cursor to the Terminal window and left-click to raise it; press Cmd-V to paste.

  • Terminal (Mac OS) to gvim (X11): Select text in Terminal window using left mouse button; press Cmd-C to copy; move cursor to gvim window and left-click to raise it; press i, I, a, or A to enter gvim's editing mode; middle-click to paste.

Note added on 06/29/09: I've recently been helping someone who had just upgraded from Tiger to Leopard, and found that no matter what she did, Cmd-C in a Mac OS window would not paste into an X11 window. After a lot of experimenting, here is how I resolved her problem:

  1. Quit X11.app if it is running (Cmd-Q or select X11→Quit X11).
  2. Open a Finder window and navigate to ~/Library/Preferences/. This is not the system-wide /Library folder, but the one in your user account home folder.
  3. Double-click on org.x.X11.plist, which will open this X11 preferences file in the Property List Editor application.
  4. You should see one line in the editor window that says

    Root     Dictionary     22 key/value pairs

  5. Click on the small triangle to the left of the word Root to toggle open the parameter listing. Parameter values (in the Values column) can be changed by clicking on the corresponding up/down arrow icon on the right side of the Values column, then selecting from the available values in the resultant pop-up menu.
  6. Ensure that all of the following parameters have values of “Yes”:

    sync_clipboard_to_pasteboard
    sync_pasteboard
    sync_pasteboard_to_clipboard
    sync_pasteboard_to_primary
    sync_primary_on_select
    wm_click_through
    wm_ffm

    The last two of these enable click-through and enable focus-follows-mouse in X11, respectively; the others enable synchronization between the various buffers that are used to store copied text.
  7. Save the modified preferences file (Cmd-S or select File→Save).
  8. Quit the Property List Editor (Cmd-Q or select File→Quit Property List Editor).
  9. The next time X11 is started (e.g., by typing xterm on a Terminal.app window command line), the copy/paste behavior should conform to the descriptions listed above.

OS Version Compatibility: Tiger (untested but probably works); Leopard.



Mac OS X Configuration Tips
by
Back to D. W. Hoard's Home Page