After some searching the equivalent command using the defaults
tool is
defaults write NSGlobalDomain AppleKeyboardUIMode -int 2
Anyone can verify this by toggling the values and then reading the key value. The default value has a value of 0 and switching it to all ui elements will turn it to a value of 2.
udev doesn't exist on OS X. As an alternative, you can use the diskutil activity
command to continuously monitor disks being mounted or ejected. The diskutil
man page says
Continuously display system-wide disk manipulation activity as reported by the Disk Arbitration framework until interrupted with a signal (e.g. by typing Control-C). This can be useful to watch system-wide activity of disks coming on-line or being ejected, volumes on disks being mounted or unmounted, volumes being renamed, etc.
Whilst running the above command and plugging in (then removing) my WD Elements USB drive, I get this output, which could be parsed (even though the man page says not to) to find, say, DiskMountApproval
and DiskDisappeared
to get the volume name and when the disk was added and removed.
***DiskPeek ('disk2') Time=20120331-11:56:22.7716
***DiskPeek ('disk2s1') Time=20120331-11:56:23.0801
***DiskAppeared ('disk2', DAVolumePath = '<null>', DAVolumeKind = '<null>', DAVolumeName = '<null>') Time=20120331-11:56:23.0810
***DiskMountApproval ('disk2s1', DAVolumePath = '<null>', DAVolumeKind = 'hfs', DAVolumeName = 'Elements') Comment=Approving Time=20120331-11:56:23.0820
***DiskAppeared ('disk2s1', DAVolumePath = 'file://localhost/Volumes/Elements/', DAVolumeKind = 'hfs', DAVolumeName = 'Elements') Time=20120331-11:56:23.2574
***DAIdle (no DADiskRef) Time=20120331-11:56:23.2576
***DiskUnmountApproval ('disk2s1', DAVolumePath = 'file://localhost/Volumes/Elements/', DAVolumeKind = 'hfs', DAVolumeName = 'Elements') Comment=Approving Time=20120331-11:56:44.2338
***DiskDescriptionChanged ('disk2s1', DAVolumePath = '<null>') Time=20120331-11:56:44.4515
***DAIdle (no DADiskRef) Time=20120331-11:56:44.4518
***DiskEjectApproval ('disk2') Comment=Approving Time=20120331-11:56:44.4542
***DiskDisappeared ('disk2', DAVolumePath = '<null>', DAVolumeKind = '<null>', DAVolumeName = '<null>') Time=20120331-11:56:50.1964
***DiskDisappeared ('disk2s1', DAVolumePath = '<null>', DAVolumeKind = 'hfs', DAVolumeName = 'Elements') Time=20120331-11:56:50.1970
***DAIdle (no DADiskRef) Time=20120331-11:56:50.1972
Best Answer
Check out cocoaDialog:
It's a pretty simple concept — pass arguments to the executable to create a dialog, and it returns a result string. There are some good examples as well as documentation.