Change window button positions
From Peter Pap's Technowiki
You'd think that this would be part of the preferences panels, but NO!
If you want them on the right:
gconftool -s /apps/metacity/general/button_layout -t string menu:minimize,maximize,close
If you want them on the left:
gconftool -s /apps/metacity/general/button_layout -t string close,maximize,minimize:menu