What dotfiles do you consider important enough to maintain across machines, and how do you manage them?
I've just been considering cleaning up some dotfiles (Why can't they all be in ~/.config/ ?), and trying to get some shared across machines so I can have a consistent feel wherever I work. Just interested in some ideas, and to just see the differing opinions and techniques.
About this post
- Posted
- Archived
- Score
- 60 · 100% up
- Kind
- Text
- ID
- 2vqisp
54 comments
xinitrc, zshrc, zprofile, xresources, my atom editor snippets, firefox userChrome, xbindkeysrc, and my window manager configs (atm, awesome rc.lua and theme.lua)
I use git. I had my own vps for awhile but I'm slowly pushing everything to github. I think ill use that for dotfiles.
I've been considering git, but I've only just started getting into it, so I wouldn't know the best way to set up a repo with the files in various directories like that.
I'm not sure if this is the best way to do it, but I have one folder called dotfiles. In it are hardlinks to the dotfiles scattered throughout. I just commit and push from there and everything is up-to-date on github. I am curious if there are other, better ways to handle thius...
i use git aswell, different branches for different machines. have a look at git immersion to get the basic knowledge for versioning, branching etc. in no time.
Just have the git repo where you maintain the files, and then create a symlink to them from the appropriate directories.
So let's say you have your
bashrcfile at e.g.~/git/config/bashrc. You'd just doln -s ~/git/config/bashrc ~/.bashrc, and then programs will follow the symbolic link at~/.bashrcto the actual path of the file.IIRC some programs aren't able to deal with symlinked config files, in which case you should use a hard link (remove the
-sfrom thelncommand earlier).I also use git. I have one repo for each subdirectory of
~/.config/, symlink anything I change into there, and use a homegrownconfgitshell script to manage them (which is probably a less polished version of gws). One repo per config "domain" cloned in as necessary, one branch per machine in each repo. Works remarkably well for me, assuming I remember (which I don't) to commit and push changes before leaving a machine powered off somewhere.I have a dotfiles github repo. I use homeshick to help with symlinking the relevant files into the repo so that i don't have to keep files in the repo and "live" files synced. It's pretty convenient. homeshick expects the files you wants symlinked to be in $repo/home/ the same way the symlinks should be in /home/user/
Absolutely agree with homesick! I keep mine under bitbucket just because they offer free private repos.
Are you a Ruby person? I suggest installing ruby using rbenv to keep it all "userland" and then using gem to install homesick -- it's really quite a slick setup.
In terms of what's important enough, I include anything that's not specific to the machine, and I have different homesick repos which are specific to environments (e.g., one for Arch, one for my Ubuntu servers, one for my home OSX machines...)
I do like ruby, but i didn't typo that name, i use "homeshick" not homesick ;) It's a homesick-standin written in bash.
(I really like ruby as a language, but i kinda can't stand relying on gems. They're slow to install, they make your scripts way less portable… I wrote an aur helper in ruby once and used it until there was a ruby update, and i had to reinstall the gems i needed in my aur helper, except i couldn't download the gem aur packages with my aur helper because the gems weren't working because of the ruby update… If you catch my drift…)
homeshick on the other hand only needs bash and git.
Homeshick is nice, but I need the .homesick_subdir feature from homesick for some hackery I use.
Oh, i wouldn't know about that, i never actually used homesick.
I've always wondered this. It always bothered me on my arch machine that the dotfiles were a scattered mess.
nearly all applications allow you to change the config location. I cleaned up my home directory from around 50 dotfiles to now 19. Steam is taking up 3 of those.
Is this done during compilation or is it a setting in the gui? Because I've only encountered this with a few web browsers and music players.
No one mentioned gnu stow yet: https://www.reddit.com/r/archlinux/comments/2r2kl9/how_do_you_automate_your_reinstalls/cnbya9p
Quick, simple, flexible and modular.
Edit: Oh wait, I wonder how I managed to type a response, because it looks like I can't read. Oh well, still helpful maybe?
I keep my urxvt, i3config, Firefox custom theme, desktop wallpapers, and emacs/vim dot files in a ~/Dotfiles folder that is also a Git repository. I use the stow command to manage symlinking files and folders to ~/
You should check out the Dotfiles at /r/unixporn that's where I got started customizing everything
I looked into using stow at one point, but I don't know if I didn't read carefully enough or what, but I couldn't understand exactly what it was or how it worked..
This provides a very simple overview of someone (not me) using it for his dotfiles repo: https://github.com/xero/dotfiles#how-it-works
Basically, for example, if you run
stow vimfrom your dotfiles directory, thevimdirectory that resides there (in the repo linked above for example) will be, by default (you can change it), symlinked to the above directory.So if you have your dotfiles directory in your home root (e.g.
~/dotfiles), then the contents in the vim directory (the.vim/folder and.vimrcfile in this case, will actually seem like they are in their correct positions under~. This is assuming a~/.vimrcdoesn't already exist.So I've always found the stow instructions to be really confusing. Here's the default behavior:
The command "stow ./bspwm/" will link all of the files in bspwm/ to two directories up (they were originally in ~/Dotfiles/bspwm and now they are in ~/ )
Files and folders become symlinked as well. If the folder already exists in the final location it moves files instead. (A good use of this is to have ~/Dotfiles/bspwm/.config/$files which will be moved into ~/.config
I hope that helped. I only use the commands "stow" and "stow -D" to stow/unstow. I now have some themes folders inside my "Dotfiles" directory so I can switch out terminal themes/ desktop environments/ background wallpapers with just a few commands.
Does stow have an easy way to deploy dotfiles if you don't have permissions to install stow systemwide?
I use Ansible and template then out from jinja2 templates. Here's my templates.
In particular, this i3status config will autodetect network interfaces. So on my laptop it autodetects one wireless and one ethernet interface, and on my desktop it autodetects two ethernet interfaces.
I'm surprised no-one else mentioned configuration management tools so far. For everyone that has a hard time maintaining those symlinks to "all over the place", you should definitely have a look at a configuration management tool. Ansible is just one example, there are many more:
http://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software
I also use Ansible for my setup, I switched to it from Puppet. I've heard great things about cdist, but haven't had a look at it yet.
#####
######
#### Comparison of open-source configuration management software:
Interesting: Puppet \(software) | [Software configuration management](https://en.wikipedia.org/wiki/Software_configuration_management) | [List of systems management systems](https://en.wikipedia.org/wiki/List_of_systems_management_systems) | Capistrano \(software)
Parent commenter can [toggle NSFW](/message/compose?to=autowikibot&subject=AutoWikibot NSFW toggle&message=%2Btoggle-nsfw+cokbuu7) or[](#or) [delete](/message/compose?to=autowikibot&subject=AutoWikibot Deletion&message=%2Bdelete+cokbuu7). Will also delete on comment score of -1 or less. | FAQs | [Mods](http://www.np.reddit.com/r/autowikibot/comments/1x013o/for_moderators_switches_commands_and_css/) | [Magic Words](http://www.np.reddit.com/r/autowikibot/comments/1ux484/ask_wikibot/)
I've found these tools are a little overkill, as they're geared more towards enterprise configuration management and application deployment.
We use puppet & cfengine at work, they're great.
.vimrc is the one I really try to keep
Yep, me too. ~/.vim and ~/.vimrc are the main ones I copy over. I typically only use one computer as a desktop, so xbindkeysrc and similar aren't relevant. vim, on the other hand, I use on servers and desktops alike.
I use fresh with a github repo. Mostly shell stuff, vim and starting to do some more with gui apps.
Fresh is pretty cool. Been using it for a couple of years without problem.
My personal favorite for managing dotfiles is rcm. Mainly I like it because it makes it easy to have multiple versions of same file in the same repo. For example I have different versions of
.zshrceach for different systems I use. The module system is handy as well, so rcm only links config files that I need on a specific host.All the dotfiles are then saved to git repository and synced across all computers I'm using, regardless of operating system.
EDIT: If you are interested, my dotfiles repo is on GitHub. It includes configuration for tmux, ssh, and zsh. I'm also thinking of adding Sublime Text configuration there. Currently that is stored to dropbox as it changes so often that doing git commits with all the changes seems stupid.
I keep my dotfiles in a repository on github.
Whenever I do a nuke and clean, or install on a new machine, if I notice something is missing I'll copy it in from a backup or another machine and add it to the repository. Right now there's mostly commandline config in there.
I use a makefile to install everything. It currently just copies, but I should probably symlink them instead to make updating them easier.
I used to share all of them, via nfs, afs, or some similar file system method. Firefox put a stop to that, it doesn't like it when you share all of .mozilla. Now I share about 50 out of my 127 dotfiles. I mostly use unison, although I still use nfs for some machines like a Raspberry pi that's always on my home network.
As to why everything doesn't just use .config, I think it's historical. Many programs date from before the appearance of .config. Some have migrated, but that takes some thought and planning on the part of the developers.
My .emacs is on github. I've been considering putting more stuff up there as well (like my zsh configs)
I'm using the python based tool dotbot to link my files from my dotfiles dict and it use to config a json or yaml file. Really small a neat.
Have a look at my dotfiles https://github.com/Azd325/dotfiles and on dotbot https://github.com/anishathalye/dotbot
Mainly editor and shell configuration (.zshrc, .vimrc, .gvimrc, .emacs, .bashrc, .vim/, .emacs.d/) and windowmanager configuration (.i3/, .pekwm/, .i3status.conf). Also a few X-related files (.Xmodmap, .xscreensaver, .xsession, xinitrc and .Xdefaults). Configuration files related to git and tmux (.tmux.conf, .tigrc, .tig/).
I have all the files stored in ~/checkout/dotfiles and check them in to a private repository at a virtual server. After reviewing configuration files, I might check them in to a dotfile repository at github.
The configuration files themselves are linked to the corresponding filenames in the home directory. I may have different files for work, home and laptop (.zshrc.work, .zshrc.home, .zshrc.laptop).
This works very well, as long as one remembers to check in the files after making changes. The amount of time it takes to create the symlinks if setting up a new computer is very small, but could be automated with a small script.
I store my dotfiles on GitHub. Everything is organized into separate packages and groups. The install script `dot' is capable of installing a given group or a list of packages. Therefor I can cherry pick the packages I need during setup of a new machine.
.vimrc (and .vim/), .bashrc (has a nice helper for git tracking), .gitconfig, .fonts/, .conkyrc (and .conky/), and lastly, .icons/.
git repos in ~/configs, that are cloned from dropbox, then use stow command to create symlinks in home directory. I keep the each machine's config in it's own branch. I also have scripts which saves the current branches to a file. Other directories like my password-store, and gnome-keyring are just symlinked from dropbox.
git repos: i3, xinit, zsh, dunst, custom commands I wrote, vim, emacs, termite, gtk3, gtk2, git, bash, ssh (without keys of course)
Deleted before we saved it.
I use dotfiles from AUR to manage the symlinks. I keep the dotfiles on Github.
I've been using GitHub to store all my dotfiles which includes i3, vim, zsh, weechat, bashrc, xinit, xresources, the nightly backup sh file to push dotfiles to git, and the sh file to symlink all my dotfiles.
Screenshot
I made a simplified symlinking script and I keep all of them under a single directory which is a GitHub repository. That's probably the third thing I do right after bootstrapping a system, I install git and clone this repo.
i version control most of my configs. i manage them w/ git, and "install" them with gnu stow. i wrote a sort article about it in the readme of my dotfiles repo: http://git.io/.files