dotlink
is a simple dotfile manager.
Imagine you keep all your configuration in ~/etc
:
$ tree ~/etc
/home/user/etc
├── git
│ ├── dotlink.conf
│ ├── gitconfig
│ └── gitignore
├── vim
│ ├── colors
│ │ └── light.vim
│ ├── dotlink.conf
│ ├── gvimrc
│ └── vimrc
└── zsh
├── dotlink.conf
├── zshenv
└── zshrc
Files dotlink.conf
specify how the dotfiles should be installed:
$ cat etc/git/dotlink.conf
[slink]
gitconfig=~/.gitconfig
gitignore=~/.gitignore
Here, git's dotfiles should be installed as symbolic links to the specified paths.
dotlink
performs their install with a simple command:
$ dotlink install etc/git
You can confirm that the files were properly installed. Either manually:
$ ls -l ~/.git*
lrwxrwxrwx 1 user users 28 1970-01-01 00:00 /home/user/.gitconfig -> /home/user/etc/git/gitconfig
lrwxrwxrwx 1 user users 28 1970-01-01 00:00 /home/user/.gitignore -> /home/user/etc/git/gitignore
Or better, via dotlink
itself:
$ dotlink status etc/git
[slink]: 'etc/git/gitconfig' => '~/.gitconfig'
[slink]: 'etc/git/gitignore' => '~/.gitignore'
dotlink
is a simple bash script. If you want, you can simply download it and
drop it into your dotfiles folder. This way it'll always be there wherever your
dotfiles are.
$ git clone
$ cd dotlink
$ sudo make install
A package is available in AUR: https://aur.archlinux.org/packages/dotlink-git/. Use your favorite AUR installer, such as yay:
$ yay -S dotlink-git
dotlink.conf
files loosely follow the INI file
format, using sections under which keys
are associated to values.
[section_a]
key_a=value_a
[section_b]
key_b=value_b
A key is the target file (or directory) located in your dotfile folder, while a value is the destination's path to which the target should be installed.
A target file should be expressed as a relative path from where the
dotlink.conf
file is located. The destination should be expressed as an
absolute path.
The section above key/value pairs specifies how the targets should be installed. There are four type of section:
slink
: install targets as a symbolic linkhlink
: install targets as a hard linkcopy
: install targets as a copyignore
: do not install the targets (and don't complain about it)
$ dotlink -h
Usage: dotlink [options] <command> <targets>...
Options:
-h/-?/--help Display this help message
-v/--verbose Verbose mode
-n/--dryrun Dryrun mode
Command:
install Install <targets>
uninstall Uninstall <targets>
status Get status about <targets>
dotlink
was written by Joël Porquet-Lupine and is licensed under the
GPLv2+.
For many parts of this work, I found inspiration in pass, the famous password manager written by the great Jason Donenfeld.