1
0
Fork 0

cleanup dotfile management

This commit is contained in:
Luca Bilke 2024-05-24 21:01:25 +02:00
parent 227ba7606e
commit c2bbea78a2
3 changed files with 22 additions and 2 deletions

View file

@ -45,7 +45,11 @@ export LESS_TERMCAP_us="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export ANSIBLE_NOCOWS=1 # Stop those fucking cows in Ansible
# dotfiles management
export DOTS_PACKAGE="dots"
export STOW_DIR="$XDG_DATA_HOME/stow"
export DOTS_REPO="git@git.snaile.de:luca/dotfiles"
# Color palette for console dialogs in tools such as nmtui and whiptail
export NEWT_COLORS='
@ -82,7 +86,6 @@ export XDG_CACHE_HOME="$HOME/.cache"
export XDG_STATE_HOME="$HOME/.local/state"
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
export STOW_DIR="$XDG_DATA_HOME/stow"
set -a
source $XDG_CONFIG_HOME/user-dirs.dirs
set +a

View file

@ -6,6 +6,16 @@ GREEN="$(tput setaf 2)"
BLUE="$(tput setaf 4)"
NC="$(tput sgr0)"
mkdir -p "$STOW_DIR/$DOTS_PACKAGE"
# First run
if [ ! -e "$STOW_DIR/$DOTS_PACKAGE/.git" ]; then
printf "%b" "${BOLD}${BLUE}Cloning dotfiles...$NC\n\n"
git clone -j4 --recursive "$DOTS_REPO" "$STOW_DIR/$DOTS_PACKAGE"
stow --no-fold -d "$STOW_DIR" -t "$HOME" "$DOTS_PACKAGE" || printf "%b" "${RED}Failed to run stow!$NC\n"
exit 0
fi
dgit() {
git -C "$STOW_DIR/$DOTS_PACKAGE" "$@"
}
@ -42,6 +52,6 @@ if [ -n "$unmerged_files" ]; then
fi
printf "%b" "${BOLD}${BLUE}Symlinking dotfiles...$NC\n\n"
stow -d "$STOW_DIR" -t "$HOME" "$DOTS_PACKAGE" || printf "%b" "${RED}Failed to run stow!$NC\n"
stow --no-fold -d "$STOW_DIR" -t "$HOME" "$DOTS_PACKAGE" || printf "%b" "${RED}Failed to run stow!$NC\n"
printf "%b" "${BOLD}${GREEN}Dotfiles synced successfully!$NC\n"

7
.stow-local-ignore Normal file
View file

@ -0,0 +1,7 @@
README\.md
TODO\.md
\.editorconfig
\.git
\.gitignore
\.gitmodules
\.local/share/service