There's lots of dotfiles managers, but my favorite is GNU Stow.
It has only two problems: boring UI and no config. Cstow solves them.
C
onst
antine's GNU Stow
wrapper.
Some GNU Stow Terminology
A target directory is the root of a tree in which one or more packages wish to appear to be installed.
A stow directory is the root of a tree containing separate packages in private subtrees.
Use pipx
pipx install cstow
Or pip
pip install cstow
Set CSTOW_CONFIG_PATH
to path/to/your/cstow_config.toml
.
Use any file name you want.
- My cstow.toml.
- More examples.
Cstow expands ~
and $AN_ENVIRONMENT_VARIABLE
.
Name | Type | Description | Default |
---|---|---|---|
root_dir | String | The root of stow directories | / |
cmd_template | String | The template for GNU Stow commands | See below |
targets_dirs | Table | Targets (keys) and dirs (values) | |
targets_dirs (key) | String | A target directory | |
targets_dirs (value) | Array of strings | Stow directories for the target |
You might set it to ~/dotfiles
or $DOTFILES
.
If you don't set root_dir
, use absolute paths in targets_dirs
.
You can set it to any shell command that contains every placeholder.
Placeholder | Description |
---|---|
action | A GNU Stow action (no, stow, restow, delete) |
target | A target directory |
dir | A stow directory for the target |
stow --$action --no-folding --verbose --target=$target --dir=$dir . \
2>&1 | grep --invert-match --regexp="^BUG" --regexp="^WARN"
# Get some help
cstow -h
cstow --help
# Run an action
cstow # Default action is 'no'
cstow delete # Action is a positional argument
cstow -a restow # But flags also work
cstow --action no
# Print plain text
cstow stow --plain
cstow restow -p
cstow -p -a delete