Random tidbits, some pasted from other pages.

Updates for 10.3

The Finder is finally using more of com.apple.finder, so this now works:
defaults write com.apple.finder NSUserKeyEquivalents '{"by Name"="@4";}'
defaults write com.apple.finder NSUserKeyEquivalents '{"Clean Up"="@5";}'
Yay for me, a hotkey for Arrange By Name. If you want both you have to do both on one line or edit com.apple.finder.plist by hand. There's also Clean Up Selection, which happens if you have something selected. (Clean Up would become option-cmd-5 if you do). If you put in both on the same key, it will just change the text and cmd-5 will do whichever is appropriate. So, I have, in com.apple.finder.plist:
        <key>NSUserKeyEquivalents</key>
        <dict>
                <key>by Name</key>
                <string>@4</string>
                <key>Clean Up</key>
                <string>@5</string>
                <key>Clean Up Selection</key>
                <string>@5</string>
        </dict>

See the XDarwin section, below, for getting X working (with good copy/paste, too).

Terminal supports FocusFollowsMouse:

defaults write com.apple.Terminal FocusFollowsMouse -string YES

Startup

Compiling

UNIX OS Configuration

General tips and tricks (mostly UI)

X11 / XFree86 / XDarwin

update for panther/10.3: the "XDarwin" project at xdarwin.org or the xonx project has become somewhat different. You can pay to get a CD or download their installer, but frankly, if you want X, you probably know how to follow directions in a shell. So there's two options.

First, if you are upgrading from a working 10.2 / XDarwin, rumor is that you can back up /System/Library/Keyboards, and then restore that on the 10.3 install.

Second, and this isn't that hard, you just install it direct from xfree86.org. xdarwin.org can point you at the exact directory if it changes; this is the one I used: binary Xfree86 xdarwin.org can email you directions ... or you can just download the Install file.

In summary: Make a new directory to download everything to - there's several files. First get Xinstall.sh, run that as "sh ./Xinstall.sh -check" and it will verify you are getting the right files - the result on 10.3.5 was "Darwin-ppc-7.x". Then get, at a minimum: Xbin XDoc Xetc Xfenc Xfnts Xlib Xman Xquartz Xxserv extract

Now get a root shell in that directory, so that we can make sure the umask is ok - run umask 022. Then "sh ./Xinstall.sh" and it will go off. It installs to /etc/X11, /usr/X11R6, and /Applications/XDarwin. That's it, you're ready to go.

One thing I did change was the definition of the color blue. For whatever reason, this seems to have changed in xfree86 4.4. (see /usr/X11R6/lib/X11/doc/RELNOTES and man.txt, search for color4) I put this in my .Xdefaults and it went back to the "old" color: XTerm*color4: blue

I can't blame the xdarwin.org folks for wanting some compensation, but in my opinion all they are really providing for the cash is a packaged installer and the bandwidth. I don't know all the history, it might seem that their actual work is what xfree86.org is distributing as XDarwin.app? Don't know.

Old info: As of XFree86 4.2.0 and XDarwin 1.1, XDarwin supports a real installer for MacOSX. (It's huge but worth it). I run X in rootless mode, with the following .xinitrc: (updated for 10.3, -cpp option to xrdb is now needed, or symlink /usr/bin/cpp3 -> /usr/bin/cpp)

#!/bin/sh
exec < $HOME/.xlog 2<&1
echo "`hostname`  $DISPLAY `date`"
set -x
xrdb -cpp /usr/bin/cpp -load $HOME/.Xdefaults
xset -b
xset m 100/20
xmodmap -e "keycode 66 = Alt_L"

# fvwm2 installed via fink
/sw/bin/fvwm2 &
xterm -g 80x3+1+1077 -fn 8x13 -n Console -C -T Console
Note that MacOSX hotkeys (like Command-H to hide XDarwin) will only work if the mouse is in the XDarwin menu bar. Also, Services still don't work. Things that might be handy:

NetInfo and Lookupd

NetInfo and Lookupd are strange. Let's look at how to play with hosts lookups. Lookupd handles all hostname (gethostbyname, etc) lookups, and by default it uses the following search order: CacheAgent, DNSAgent, NIAgent. NIAgent is NetInfo. Notably missing here is any kind of file lookup. We'll get to that in a bit.

There's three things I'd like to be able to do: Add a host entry, change the lookup order, and read from /etc/hosts. The first is a simple workaround for adding hosts that don't DNS. If that's all you need, it's pretty easy. We'll start with some basic netinfo management commands. If you want to do this all via NetInfo Manager, go right ahead, that's probably just as easy.

Examples: Reading from netinfo: nidump and nicl

{~}(11:24)[186] nicl / -list /
1          users
7          groups
31         networks
33         protocols
48         rpcs
77         services
141        aliases
150        mounts
151        printers
152        localconfig
156        config
27         machines
{~}(11:24)[187] nicl / -list /machines
28         phoenix
29         broadcasthost
30         -DHCP-
In this example, the first / is the "netinfo domain", where / is the root of the local machine. /machines is the host entries.
{~}(11:25)[193] nidump hosts /
127.0.0.1       phoenix
255.255.255.255 broadcasthost
255.255.255.255 -DHCP-
{~}(11:25)[194] nidump -r /machines /
{
  "name" = ( "machines" );
  CHILDREN = (
    {
      "ip_address" = ( "127.0.0.1" );
      "name" = ( "phoenix" );
    },
    {
      "ip_address" = ( "255.255.255.255" );
      "name" = ( "broadcasthost" );
    },
    {
      "ip_address" = ( "255.255.255.255" );
      "name" = ( "-DHCP-" );
    }
  )
}
Two more ways to get the info, depending what you want to do with it. The first one is great for reading into niload if you want to break things. For instance, you could do:
{~}(11:27)[198] nidump hosts / | tee hosts.save
127.0.0.1       phoenix
255.255.255.255 broadcasthost
255.255.255.255 -DHCP-
{~}(11:27)[199] sudo nicl / -delete /machines
{~}(11:27)[200] nidump hosts /
{~}(11:27)[201] sudo niload hosts / < hosts.save
{~}(11:28)[202] nidump hosts /
127.0.0.1       phoenix
255.255.255.255 broadcasthost
255.255.255.255 -DHCP-
...as an example of blowing away all your hosts entries from netinfo. Note that the CacheAgent of lookupd probably still has any that you used, so either run lookupd -flushcache (with mixed results) or run kill -HUP `cat /var/run/lookupd.pid` to flush those entries out. Since we also just used niload in the previous example, this is how you get some static entries into netinfo. Make a file with the hosts you want, in /etc/hosts format, and load them the same way (niload hosts / <file).

Now the real solutions: changing the lookup order and reading from files. This is really done at the same time. To start, go read the lookupd man page, it's good stuff. We can control the lookup order for hosts two different ways: via netinfo or via files. I wanted to try netinfo to get in the OSX spirit, but even after trying several things that seemed to match the lookupd man page, it wouldn't work. So, we'll do files. A start would be to look at the current config:

{~}(11:34)[226] lookupd -configuration

ConfigSource: default
LookupOrder: CacheAgent NIAgent DSAgent
MaxIdleServers: 16
MaxIdleThreads: 16
MaxThreads: 16
TimeToLive: 43200
Timeout: 30
ValidateCache: YES
ValidationLatency: 15
_config_name: Global Configuration

LookupOrder: CacheAgent DNSAgent NIAgent DSAgent
_config_name: Host Configuration

TimeToLive: 60
ValidateCache: NO
_config_name: Group Configuration

LookupOrder: CacheAgent DNSAgent NIAgent DSAgent
_config_name: Network Configuration

ConnectTimeout: 300
_config_name: NIAgent Configuration
Already we see something we don't know: the DSAgent. It's not in the man page so who knows what that is, we'll just leave it at the end like it is.
{~}(12:21)[297] sudo mkdir /etc/lookupd
{~}(12:21)[298] cat hosts
LookupOrder CacheAgent FFAgent NIAgent DNSAgent DSAgent
{~}(12:21)[299] sudo cp hosts /etc/lookupd
{~}(12:21)[300] lookupd -configuration | grep -B1 Host
LookupOrder: CacheAgent DNSAgent NIAgent DSAgent
_config_name: Host Configuration
{~}(12:22)[301] grep manticore /etc/hosts
192.168.168.28  manticore.anybrowser.org manticore
{~}(12:22)[302] ping manticore
PING manticore.anybrowser.org (66.80.62.206): 56 data bytes
^C
--- manticore.anybrowser.org ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
{~}(12:22)[303] sudo kill -HUP `cat /var/run/lookupd.pid`
{~}(12:23)[304] lookupd -configuration | grep -B1 Host
LookupOrder: CacheAgent FFAgent NIAgent DNSAgent DSAgent
_config_name: Host Configuration
{~}(12:23)[305] ping manticore
PING manticore.anybrowser.org (192.168.168.28): 56 data bytes
64 bytes from 192.168.168.28: icmp_seq=0 ttl=254 time=5.944 ms
64 bytes from 192.168.168.28: icmp_seq=1 ttl=254 time=4.52 ms
^C
--- manticore.anybrowser.org ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 4.52/5.231/5.944 ms

Recommended Reading