Sunday, December 28, 2008

Progress on setting the Mac up properly...

Enabled a root account:

In versions prior to 10.5 this could be done with NetInfo (part of the Apps/Utilities folder). Now this is done graphically using Directory Manager (not System Preferences/Accounts, as you might have assumed). Selected Edit->Enable Root User and enter a password.

Set up the locate database for the the locate command:

Become root or use sudo to execute the following command:
/usr/libexec/locate.updatedb

Ignore the warning about this being a security risk. Control over which directories to scan should be set in /etc/locate_rc, although Apple does not provide one by default. TODO: By default the locate database is only updated once a week. This should be changed to once a day. See the /etc/periodic/weekly directory.

Setting a fixed machine name:

The main ComputerName can be set/reset in System Preferences/Sharing. However this is not the same as the node name as you'd see executing "uname -n". As far I can determine the best way to set the machine name(s) is to use "scutil --set" to set the ComputerName, LocalHostName and HostName.

scutil --set ComputerName azathoth
scutil --set LocalHostName azathoth
scutil --set HostName azathoth

These changes are retained between successive boots of the machine.

Making Terminal and X11 appear by default in the dock:

Start either app the normal way from Finder. Their icon will appear in the dock. Right-click on their icon (if you have set up right click, otherwise control-click on the icon) and select "Keep in Dock" and/or "Open at Login".

Switch off xterm beeping:

Failure!

xset b off doesn't seem to work by default as /usr/X11/bin is not in the default path. Doing /usr/X11/bin/xset b off does work within the invoking xterm, but so far I have failed in preventing beeps on an automatic and system-wide basis.

Trying to create a user-specific .xinitrc, even one that invokes quartz-wm, does not work for me. In most cases X doesn't even start successfully, and if it does then the xterm it starts still invokes the bell. I am beginning to suspect that I may have to set it to use visual bell. Copying the system xinitrc from/usr/X11/lib/X11/xinitrc and modifying that doesn't seem to work either.

Focus Follows Mouse:

It appears to be impossible to get full focus follows mouse behaviour under OSX, which is incredibly backwards. However a very limited form of it is possible just for Terminal windows (and possibly xterms) by executing the following in a Terminal:

defaults write com.apple.Terminal FocusFollowsMouse -string yes

This works (after a small delay) in giving limited FFM in just the Terminal.

For xterms the following is claimed to work:

defaults write com.apple.x11 wm_ffm true

But this does not appear to work on my Macbook, with or without a -bool between the wm_ffm and the true. As I don't really intend to use a vanilla xterm for real work anyway I'm hoping this (and the copy/paste difficulties between X11 and OSX) limitation won't end up driving me crazy.

No comments: