My configuration files for different programs that I use. This repo uses GNU Stow to automatically create symlinks to the relevant directories and files from the user home directory ~
.
Part | Details |
---|---|
Device | Razer Blade Stealth/Dell XPS 13/Macbook Pro M1/Samsung S23 |
OS | Arch Linux/MacOS/Android |
Shell | zsh |
Terminal Emulator | Kitty/Termux |
Window Manager | i3-gaps/yabai |
Editor | NeoVim |
Browser/PDF Reader | QuteBrowser |
Font | LigaSauceCodePro Nerd Font |
Colorscheme | Various (see scripts/colorscheme/colors/*.json ) |
Clone repository with submodules (some maybe private)
$ git clone --recurse-submodules <ssh_or_https_repo_url>
If already cloned without submodules, use
$ git submodule update --init --recursive --remote
Make sure stow
is installed
$ sudo pacman -S stow # arch linux/pacman
$ brew install stow # macos
$ pkg install stow # termux
$ sudo apt install stow # ubuntu/debian
Use stow to create or remove symbolic links for different programs
For understanding stow terminology, see [Stow Terminology](#Stow Terminology)
This repo contains git submodules. Some are private repos that only I should have access to.
$ git clone --recurse-submodules <repo_url>
# or if forgotten to do it at clone
$ git submodule update --remote --merge
-
Create directory with name of program for which the config files will be linked e.g.
zsh
. -
Recreate config directory structure in this directory. For instance,
neovim
would have the following directory structure:neovim └── .config └── nvim └── init.vim
Then run one of the following. Note: <program_dir_name>
refers to the name created in the first step.
# for testing out use -n
$ stow -nSvt ~ <program_dir_name>
$ stow --simulate --stow --verbose --target=$HOME <program_dir_name>
# for actually creating the link
$ stow -Svt ~ <program_dir_name>
$ stow --stow --verbose --target=$HOME <program_dir_name>
# in case config already exists, use --adopt to force stow to link
$ stow --adopt -Svt ~ <program_dir_name>
$ stow --adopt --stow --verbose --target=$HOME <program_dir_name>
For <program_dir_name>
, use the top level directory name that is in the repo, e.g. neovim
, zsh
, bash
# for testing out use -n
$ stow -nDvt ~ <program_dir_name>
$ stow --simulate --delete --verbose --target=$HOME <program_dir_name>
# for actually creating the link
$ stow -Dvt ~ <program_dir_name>
$ stow --delete --verbose --target=$HOME <program_dir_name>
# in case config already exists, use --adopt to force stow to link
$ stow --adopt -Dvt ~ <program_dir_name>
$ stow --adopt --delete --verbose --target=$HOME <program_dir_name>
- target dir: the directory where the linked files will be created.
- this is the directory the files/dir would ideally be at without gnu stow
- example: for neovim, this would be
~/.config/nvim
- source dir: the directory where the linked files will be sourced from.
- this is the directory the files/dir would actually be at
- example: for neovim, this would be
~/dotfiles/neovim/.config/nvim
If the target directory is empty and source directory is NOT empty, i.e.
$ tree ~/.config/test
# /home/mushfiq/.config/test [error opening dir]
#
# 0 directories, 0 files
$ tree -a ~/dotfiles/test
# /home/mushfiq/dotfiles/test
# └── .config
# └── test
# └── test.rc
#
# 2 directories, 1 file
$ cat ~/dotfiles/test/.config/test/test.rc
# from dotfiles
Then the target directory contents will be linked to the source directory contents. This also works if there are other files that are in the target directory that are also not in the source directory. e.g., if there was a second file in ~/.config/test/another.rc
and stow
was called, that file will remain unchanged.
$ stow --adopt --verbose --target=$HOME --no-folding --stow test
$ tree ~/.config/test
# /home/mushfiq/.config/test
# └── test.rc -> ../../dotfiles/test/.config/test/test.rc
#
# 0 directories, 1 file
$ cat ~/.config/test/test.rc
# from dotfiles
$ cat ~/dotfiles/test/.config/test/test.rc
# from dotfiles
If both the source directory and the target directory is NOT empty, the files in the source directory will get overwritten by the target. i.e.
$ tree -a ~/.config/test/
# /home/mushfiq/.config/test/
# ├── another.rc
# └── test.rc
#
# 0 directories, 2 files
$ cat ~/.config/test/test.rc
# from config dir
$ cat ~/dotfiles/test/.config/test/test.rc
# from dotfiles
$ stow --adopt --verbose --target=$HOME --no-folding --stow test
$ cat ~/.config/test/test.rc
# from config dir
$ cat ~/dotfiles/test/.config/test/test.rc
# from config dir
$ tree -a ~/dotfiles/test/.config/test
# /home/mushfiq/dotfiles/test/.config/test
# └── test.rc
#
# 0 directories, 1 file