Showing posts with label geek. Show all posts
Showing posts with label geek. Show all posts

Friday, August 31, 2007

Terminating Apple's Dock with extreme prejudice

I've been using Mac OS X since late 2002 - five years now, I guess. In all that time, I've been trying, on and off, to do without the Dock. I've tried various little apps I've downloaded here and there, and none of them were white what I was looking for. (There's that whole "it doesn't work" thing that irked me about most of them.)

The closest I'd ever found that actually worked was setting the dock size to minimum and using TinkerTool to move it to the top of the screen, just below the menu bar. That worked, middling well, but the damn thing would still pop up if you were too slow in moving the mouse over it.

Now, however, I've figured out a working way to do it. All it takes is a bit of Terminal work, and the Dock is dead. Here's how it works.

in Terminal, enter these commands:
cd /System/Library/CoreServices
sudo mv Dock.app Dock.app.backup
sudo killall Dock


The first line is not necessary, but I use it to get into the CoreServices directory. That way, I can use relative paths when moving/renaming the dock, and save a few keystrokes.
The second line renames the Dock, and the third line kills it. Ding-dong, the dock is dead, the wicked dock is dead!

To reactivate the Dock, use these commands:
cd /System/Library/CoreServices
sudo mv Dock.app.backup Dock.app
sudo osascript -e 'tell app "dock" to activate'


Now for the drawbacks.

1: the built-in command-tab app switcher is part of the dock. No dock, no app switcher. No problem, I've got LaunchBar, Keyboard Maestro and DragThing installed, each of which has its own version of an app switcher.

2: window minimizing is also tied into the dock. With the dock gone, I can't minimize windows. Bummer, that, but then again, since I only minimized a window once or twice a month, big whoop.

3: Expose is missing in action. Big deal, I've never used it.

4: Apparently, the Finder Desktop is also connected to the Dock. Path Finder's desktop as well, it seems. Again, big deal. I don't use the Desktop.

I've come up with/found workarounds for items 1 and 4. At the moment, I'm using Keyboard Maestro's app and window switchers.

As long as the Dock runs, the Desktop is accessable, even if you turn around and kill the Dock shortly afterward. I found this short how-to on starting/killing the Dock and making the Desktop workable.

Step 1: write a small applescript:
tell application "Dock"
quit
end tell

Save it as an application.

Step 2: move or copy the Dock to /Applications (or wherever else your fancy leads you).

Step 3: put both the Dock and your dock-killing applescript application into your startup items, making sure that the Dock loads well before the dock-killer.

I have no workarounds at present for the lack of window minimalization or expose's failure to work without the Dock, and I probably won't work on them too hard, since I don't use either one.

Need I add that like all system hacks, you should make backups before starting? If you try this at home, I am not responsible for any loss of data, productivity, or if your Mac OS install turns into Windows Vista.

Friday, February 2, 2007

Yay, me (or, how to mount /Users on a second HD)

Got a new (as in, not so old) Mac yesterday. Voided the warranty in less than an hour, when I cracked the case to add a gig of RAM and a 250 GB hard drive. Part of the master plan is to mount the 250 as /Users. Figured it shouldn't be that hard, since it takes all of about two minutes in K/X/Ubuntu - just a quick edit of /etc/fstab. (What's that you say, about mice and men?)

I found the following instructions:
edit /etc/fstab.hd:
comment out all existing text (the instructions actually said to delete it all, but I'm a digital packrat.)
enter this line:
LABEL=Users /Users hfs rw 1 2
save & exit
transfer /Users to new drive:
sudo ditto -v -rsrcFork /Users Volumes/Users
reboot into single user mode & issue these commands:
cd /
mv Users Users-old
mkdir Users
chmod 755 Users

reboot & update Netinfo to recognize fstab:
sudo niload -m fstab / < /etc/fstab

All the commands took, the files were all copied over onto the new drive, but when I rebooted again, I was in a new, untouched home folder. After poking around some more, I came up with these instructions.

OtherPartition = "Users" and username should be obvious.

sudo ditto -rsrcFork /Users /Volumes/OtherPartition/Users
I'd already done almost this exact command, with the addition of the -v flag, so I ignored it.
sudo niutil -createprop / /users/username home /Volumes/OtherPartition/Users/username
note that sudo niutil through username is all one line
sudo rm -dr /Users
I've already backed up /Users as /Users-old, so I figured I could delete that whenever I felt like it. Thus I ignored this command, as well.
sudo ln -s /Volumes/OtherPartition/Users /Users

And this worked better, because home was now on the new drive, but it was still a new, untouched home folder, and my home folder is extremely touched. So, back to poking around some more. I'm sure some of you already know what I did wrong. The niutil and ln commands were written for separate partitions on the same drive, not on an entirely different drive. I logged back in as root, deleted /Users/Users and issued these commands:
sudo niutil -createprop / /users/username home /Volumes/Users/username
sudo ln -s /Volumes/Users /Users

Again, sudo niutil through username is all one line.

And now it works. Yippee. I'm not exactly sure precisely which steps are necessary, i.e. I'm not sure I need to dink with the fstab.hd and the symbolic link between /Users and /Volumes/Users, but I plan to find out later this weekend, when I add two more drives and set it up for dual boot between OS X and K/X/Ubuntu.