Skip to content

Dotfiles

cd ~
git clone [GIT-DOTFILES-URL] .dotfiles
cd ~/.dotfiles

tree -a -L 3 --gitignore -I .git -d
.
├── autokey
   └── .config
       └── autokey
├── bash
   └── .config
       └── bash
├── clipit
   └── .config
       └── clipit

... skipped ...

├── rofi
   └── .config
       └── rofi
├── scripts
   └── .scripts
├── terminator
   └── .config
       └── terminator
├── transmission-remote-gtk
   └── .config
       └── transmission-remote-gtk
├── vim
└── X

Stow

https://www.gnu.org/software/stow/manual/html_node/Types-And-Syntax-Of-Ignore-Lists.html

Link

cd ~/.dotfiles
# Dry run
stow -v -t ~ -S * -n
stow -v * -n
# Apply all
stow -v -t ~ -S *
stow -v *

Unlink

# Unlink Dry run
stow -v -D * -n
# Unlink
stow -v -D *

Some files

.stow
.nonstow

Commands & configs

common.list

autokey
bash
clipit
flameshot
fontconfig
gtk
i3
....
X
zsh
p10k.zsh

Configure the individual hostname.list with not common package configuration.

./setdot.sh

#!/usr/bin/env bash
#
# set Actual working path
BP="${HOME}/.dotfiles"
#
OLDPWD=$(pwd)
cd ${BP}
#
# Function 
apply() {
  echo "[+] Apply: $1"  
  for i in $(grep -v '^#\|^$' "${1}" | sort -u); do
    stow -v $i
  done
}
#
# Common part for all machines
F=${BP}/common.list
apply "${F}"
#
# checking for exit file with hostname
F="${BP}/${HOSTNAME}.list"
if [ -f ${F} ]; then 
  apply "$F"
fi
#
cd ${OLDPWD}
echo "[+] Stow by dotfiles completed"
#

Aliases

dotf='/usr/bin/git --git-dir="${HOME}/.dotfiles/.git/" --work-tree="${HOME}/.dotfiles/"'
dotf-set=${HOME}/.dotfiles/setdotf.sh
dotf-update='dotf pull && dotf add . && dotf commit -m "update from ${USER}:${HOST} ($(date +"%Y.%m.%d %H:%M"))" && dotf push'