Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, I use a pretty simple setup:

I have a ~/dotfiles directory in which I have one directory for each program/entity I want to manage using stow. Let's say I want to manage my GNOME keyrings and my settings for the program EasyStroke. My ~/dotfiles directory would look like this:

  ~/dotfiles
  ├── easystroke
  │   └── .easystroke
  │       ├── actions-0.5.6
  │       └── preferences-0.5.5
  └── keyrings
      └── .local
          └── share
              └── keyrings
                  ├── login.keyring
                  └── user.keystore
Then, in ~/dotfiles I can do "stow easystroke" and it will create ~/.easystroke and there it will symlink "actions-0.5.6" to ~/dotfiles/easystroke/.easystroke/ actions-0.5.6 and "preferences-0.5.5" to ~/dotfiles/easystroke/.easystroke/preferences-0.5.5


What's the advantage over doing (assuming GNU cp):

  cp -sr ~/dotfiles/easystroke/.easystroke ~/


Stow can handle multiple directories in one go. For my powerline config:

    vim-powerlinefonts
    ├── .config
    │   └── fontconfig
    │       └── conf.d
    │           └── 10-powerline-symbols.conf
    └── .local
        └── share
            └── fonts
                └── PowerlineSymbols.otf
I just do "stow vim-powerlinefonts" and it creates the directories and symlinks as needed.

For your cp example I would have to do "cp -sr ..." twice and also think about missing directories in the tree, and possibly create them.


Question on stow that you might have knowledge on.

Could I say have stow manage separate or conflicting files?

An example is in order, say for work I have a .gitconfig that has a separate email address etc... and for home I have basically the same but not quite. Would there be any easy-ish way to say something akin to: ok this is the base of things, these are the generalized components that override?

I have a jacky way of doing this now but any way to eliminate the nonsense would be helpful. xstow looks interesting however.


Stow can do that if you only need files to be replaced, not sections of files. Let's say you want to manage the file ~/test/.gitconfig, you can create this structure:

  $ cd ~/gittest
  $ tree -a
  ~/gittest/
  ├── gitconfig-home
  │   └── test
  │       └── .gitconfig
  └── gitconfig-work
      └── test
          └── .gitconfig
  $ cat ~/gittest/gitconfig-home/test/.gitconfig
  git config 1
  $ cat ~/gittest/gitconfig-work/test/.gitconfig
  git config 2
  $ stow --no-folding --override='.+/.gitconfig' gitconfig-home
  $ cat ~/test/.gitconfig 
  git config 1
  $ stow --no-folding --override='.+/.gitconfig' gitconfig-work
  $ cat ~/test/.gitconfig 
  git config 2
If you need to manage sections of files, take a look at dotdee[0] or update-dotdee[1]

[0] - https://launchpad.net/dotdee [1] - https://pypi.python.org/pypi/update-dotdee


That helps thanks. So note for now I just copy/update my entire gitconfig and replace the one off changes every so often.

Its not ideal but each difference is really an entire file. I worded my question poorly in that regard but i'll have a look at dotdee.

I'm somewhat tempted to just use m4 for generating the dot files for things that may change and doing a conf.d type setup that just lets me copy a fragment file into place then instantiate the file.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: