Skip to content

danielt812/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

296 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles


This repository manages shell and application configuration using GNU Stow, with a Makefile

Prerequisites


  • git
  • stow
  • make
# 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 make

Install


Clone the repository into ~/.dotfiles

git clone git@github.com:danielt812/dotfiles.git .dotfiles

Repository layout:

~/.dotfiles/
    config/ # packages meant for $XDG_CONFIG_HOME
    home/ # packages meant for $HOME

Stow via Makefile


All Stow commands are wrapped by make targets.

From inside the repo

cd "$HOME/.dotfiles"

Dry run

make dry

Apply (stow)

make stow

Restow

make restow

Uninstall (unstow)

make unstow

Adopt existing files

Move existing files into the repo and replace them with symlinks.

make adopt

Use adopt carefully if you already track a file in the repo, because it can overwrite the repo copy with the machine's current copy.

Conflicts


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.

Shell setup (bash and zsh)


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.

Bash


# 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"

Zsh


# 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"

Uninstall


cd "$HOME/.dotfiles"
stow -D -t "$HOME" home
stow -D -t "$XDG_CONFIG_HOME" config

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors