This repository manages shell and application configuration using GNU Stow, with a Makefile
gitstowmake
# MacOS
brew install stow
# Debian
sudo apt update && sudo apt install stow make
# Fedora
sudo dnf update && sudo dnf install stow make
# Arch
sudo pacman -S stow makeClone the repository into ~/.dotfiles
git clone git@github.com:danielt812/dotfiles.git .dotfilesRepository layout:
~/.dotfiles/
config/ # packages meant for $XDG_CONFIG_HOME
home/ # packages meant for $HOMEAll Stow commands are wrapped by make targets.
From inside the repo
cd "$HOME/.dotfiles"make drymake stowmake restowmake unstowMove existing files into the repo and replace them with symlinks.
make adoptUse adopt carefully if you already track a file in the repo, because it can overwrite the repo copy with the machine's current copy.
If Stow reports conflicts (existing files that are not owned by Stow), you have two options:
Backup and remove the conflicting files, then re-run make stow, or
Use make adopt to move the existing files into this repo and replace them with symlinks.
This repo expects shared shell config to live under:
- ~/.config/sh/exports.sh
- ~/.config/sh/aliases.sh
- ~/.config/sh/functions.sh
After stowing config, add the following to the end of your shell rc file.
# Source shared shell config
: "${XDG_CONFIG_HOME:="$HOME/.config"}"
SH_DIR="$XDG_CONFIG_HOME/sh"
[ -f "$SH_DIR/exports.sh" ] && . "$SH_DIR/exports.sh"
[ -f "$SH_DIR/aliases.sh" ] && . "$SH_DIR/aliases.sh"
[ -f "$SH_DIR/functions.sh" ] && . "$SH_DIR/functions.sh"# Source shared shell config
: ${XDG_CONFIG_HOME:="$HOME/.config"}
SH_DIR="$XDG_CONFIG_HOME/sh"
[[ -f "$SH_DIR/exports.sh" ]] && source "$SH_DIR/exports.sh"
[[ -f "$SH_DIR/aliases.sh" ]] && source "$SH_DIR/aliases.sh"
[[ -f "$SH_DIR/functions.sh" ]] && source "$SH_DIR/functions.sh"cd "$HOME/.dotfiles"
stow -D -t "$HOME" home
stow -D -t "$XDG_CONFIG_HOME" config