How can I make a keyboard configuration become default when I hook it up? At work, I have a MacBook Pro and a RHEL workstation that share a HP keyboard and mouse via a KVM switch. I do most of my work on the Mac so I prefer to change the modifier keys so they command and alt are in the same positions as an Apple keyboard. Here is a screencast to demonstrate the exact options I change:
http://screencast.com/t/5mYQwMEVzwP0

The problem is, whenever I switch the KVM or disconnect the Mac, I have to usually have to go back into System Preferences to make the change. Is there some way I could automate this?
I'm not sure if it'll support the switching case you describe 100%, but KeyRemap4Macbook will probably get you most of the way there. You can set different options for the internal and external keyboards, for example.