
Photo by The New York Public Library on Unsplash
Centrally manage configuration files
Stow It!
Individual application configurations, saved in what are known as dotfiles, are hidden files typically kept in a user's home directory. You can manage these files centrally in a number of ways. Applications usually search for their configuration either in a user's home directory or in ~/.config
, which is the default for the XDG_ CONFIG_HOME
variable. It is part of the Cross-Desktop Group's (XDG's) generic XDG base directory specification [1], which includes several standards for the configuration of desktop applications and also applies to text-only applications.
Of course, you'd be smart not to rely on your own configuration files being available simply locally but to store them centrally, as well (e.g., in a Git repository). A relatively easy approach would be to store all the dotfiles in a central directory under Git's control and then simply define symlinks to the files. However, this method will not do the trick, because the applications themselves also need to be installed there, including all their dependencies and the plugins they use, as expected by the configurations.
GNU Stow and Ansible
A very simple but powerful solution to this problem involves the use of just two tools: Stow and Ansible. Stow [2] comes from the GNU project and was originally developed to manage manually compiled software with symlinks. One nice side effect is that you can apply this capability to configuration files.
Stow manages related files in so-called packages, which are located in a Stow directory. The target folder is the directory in which Stow creates symbolic links to the packages and the files they contain and is typically a user's home directory, the ~/.config
folder, or the folder assigned to the XDG_CONFIG_HOME
variable. In other
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
