The "Obsessive-Compulsive Directory"
UPDATE: I moved this from svn to git. An updated version of this blog post now lives here: http://wiki.eater.org/ocd.
I've had this idea in the back of my head since I read a similar approach years ago, but I just recently got around to actually doing it.
I got tired of having my common dotfiles (
.bashrc, .pythonrc, .vimrc, etc.) horribly out of sync across all the different workstations and shells I use on a regular basis. So, I rewrote them in a way to be generic, allowing host-specific and domain-specific files to be sourced as appropriate.I also included window-manager specifics, like my Fluxbox configuration, and even included common background wallpaper images.
Additionally, I sync my favored vga-fonts, and the xsession bits to enable them.
Now I can go from freshly installed box to nice-and-cozy customized box all without any tedious work.
If you want to steal all of it for yourself, do this:
which svn || sudo apt-get install subversion
svn checkout http://eater.googlecode.com/svn/branches/release/ocd ~/.ocd
cd ~/.ocd && ./update
Currently, that will give you the following files:
.bash_logout
.bash_prompts
.vim/py.vim
.Eterm/themes/Eterm/theme.cfg
.Eterm/themes/Eterm/user.cfg
.fluxbox/startup
.fluxbox/init
.fluxbox/keys
.fluxbox/menu
.fluxbox/styles/eater
.screenrc
.pythonrc.py
.fonts/fkp.pcf
.fonts/sabvga.pcf
.bashrc
.xsession
.pydistutils.cfg
.bg/water_trees_1440x900.jpg
.bg/enetics_3200x1200.jpg
.bg/smoke_1920x1200.jpg
You can browse all of these here.
The update script is just a simple bash script I wrote in all of 30 seconds to copy things over and
chmod -w so you don't forget to edit the revision-tracked copies. It backs up your existing stuff, but naturally you should read over the code and understand what it's doing before you run it. I'm just a random person from the Internet; for all you know, I'm installing a key-sniffer or something.Fluxbox users: you'll want to manually symlink
~/.bgimg-$(hostname -f) to your preferred background image for that workstation. It's set from .fluxbox/startup.The
.xsession will look for a ~/.synergyrc file and execute it. (My .syngeryrc isn't in the svn repository.)I wouldn't recommend using my personal svn repository indefinitely. It's easy enough to make your own copy of these files in your own repository and adjust them as you see fit... not to mention tracking and syncing changes across all the workstations that you use. (I'd love to hear tips you come up with from doing this yourself!)
When I change something in my
~/.ocd directory, I just do a svn commit back to the main repository. Then I can grab the changes from any of my other machines, something like this:
eater@yourmoms(1):~/.ocd:
$ svn up
At revision 42.
eater@yourmoms(2):~/.ocd:
$ ./update
Old files saved in '/home/eater/.ocd_backup.tar.gz'.
.................. All Done!