managing dotfiles with gnu stow - Printable Version
+- nixers (
+-- Forum: Operating Systems (
+--- Forum: GNU/Linux (
+--- Thread: managing dotfiles with gnu stow (/showthread.php?tid=1533)
Pages: 1 2

managing dotfiles with gnu stow - xero - 05-08-2014

it's been said of every console user: "you are your dotfiles".

i manage mine with gnu stow, a free, portable, lightweight symlink farm manager. this allows me to keep a versioned directory of all my config files that are virtually linked into place via a single command. this makes sharing these files among many users (root) and computers super simple. and does not clutter your home directory with version control files.

stow is available for all gnu/linux and most other unix like distributions via your package manager.

sudo pacman -S stow
sudo apt-get install stow
brew install stow

how it works
by default the stow command will create symlinks for files in the parent directory of where you execute the command. so my dotfiles setup assumes this repo is located in the root of your home directory ~/dotfiles. and all stow commands should be executed in that directory. otherwise you'll need to use the -d flag with the repo directory location.

the rest of this article will directly corrilate to my dotfiles, they're available here:

to install most of my configs you execute the stow command with the folder name as the only argument.

to install herbstluft theme use the command:

stow herbstluftwm

this will symlink files to ~/.config/herbstluftwm and various other places. (note the folder structure on the herbstluftwm directory)

but you can override the default behavior and symlink files to another location with the -t (target) argument flag.

to install the ryu-login you need to execute the command:

stow -t / ryu-login

this will symlink the file to /etc/issue.

note: stow can only create a symlink if a config file does not already exist. if a default file was created upon program installation you must delete it first before you can install a new one with stow. this does not apply to directories, only files.

navigate to your home directory

cd ~

clone the repo:

git clone

enter the dotfiles directory

cd dotfiles

install the zsh settings

stow zsh

install the root zsh settings

sudo stow zsh-root -t /root

install awesomewm theme

stow awesome

uninstall awesome theme

stow -D awesome

install herbstluftwm

stow herbstluftwm

i hope this gives you some ideas for managing your own dotfiles!

RE: managing dotfiles with gnu stow - yrmt - 05-08-2014

That looks nice, thanks for making the tutorial.

RE: managing dotfiles with gnu stow - z3bra - 05-08-2014

Nice howto ! That's the type of content that would fit nicely in the diary

RE: managing dotfiles with gnu stow - dami0 - 05-08-2014

I know I sound like a dick; but why not Git or CVS?

RE: managing dotfiles with gnu stow - z3bra - 05-08-2014

git : version your dotfiles, save them online, as well as previous copies.
stow: symlink file manager, you can see it as a smart way to deploy your versionned dotfiles

so basically:

git clone git:// ~/etc
cd ~/etc
stow file

(I don't know the syntax or whatsover, just explaining how you could use it)

RE: managing dotfiles with gnu stow - xero - 06-08-2014

you got it z3bra! i keep my dotfile in a git repo ( then *IN* that repo i use the stow command to link the files into place. it keeps your home directory cleaner (no version control files in the root) and all the dotfiles in one place. so when i make changes to say my zsh aliases, i don't have to copy the file into the repo. i just update the file in the repo and the symlink makes the change virtually in place.

RE: managing dotfiles with gnu stow - dami0 - 06-08-2014

Oh that actually does make sense. Might check it out soon, thanks xero!

RE: managing dotfiles with gnu stow - AlexTes - 03-12-2016

This guide just brought my dotfiles set-up to a much better place.

RE: managing dotfiles with gnu stow - JoshuaRLi - 06-06-2019

Long time GNU Stow user here, and have been recently working on a simpler replacement called sym. source is here and some rationale and usage can be found in the readme. It requires python 3.6+, stdlib only, and am planning on using it as a reference implementation for a rewrite in some compiled language in the future when I have more time.

Let me know what you guys think. I migrated my dotfiles installation to it like this, main benefits being:
  • you can specify more than one source directory so as to invoke the tool only once, as opposed to stow multiple times
  • a cleaner default command line invocation (e.g.
  • source directory location can be arbitrary and not limited to 1 directory level (stow will complain about "slashes not permitted in package names")
  • better cleanup (will remove empty dirs resulting from symlink removal)
  • 100-ish LoC, clean and readable

RE: managing dotfiles with gnu stow - JoshuaRLi - 06-06-2019

There's one feature I'll be adding soon - the ability to specify repeatable --include and --exclude glob patterns (or, probably regexes) to compliment the default blacklist. If there are any other feature requests or criticisms, do let me know, but regarding the former I'd like to keep sym as simple as possible for the use case at hand.