Add desktop branch ...
... that assumes a running GNOME on X11
This commit is contained in:
parent
7cf5654a4b
commit
46b9bacd18
2 changed files with 32 additions and 9 deletions
|
|
@ -16,10 +16,11 @@ XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
|||
|
||||
# Each branch's first commit sets the default to its own name
|
||||
# => Overridable via the environment (e.g., done by `dotfiles-update`)
|
||||
DOTFILES_BRANCH="${DOTFILES_BRANCH:-main}"
|
||||
DOTFILES_BRANCH="${DOTFILES_BRANCH:-desktop}"
|
||||
|
||||
DOTFILES_DIR="${DOTFILES_DIR:-$XDG_DATA_HOME/dotfiles}"
|
||||
DOTFILES_HTTPS="${DOTFILES_HTTPS:-https://code.webartifex.de/alexander/dotfiles}"
|
||||
DOTFILES_SSH="${DOTFILES_SSH:-git@git.webartifex.de:alexander/dotfiles.git}"
|
||||
|
||||
BACKUPS_DIR="$XDG_STATE_HOME/dotfiles-backups"
|
||||
BACKUP_DIR="$BACKUPS_DIR/$(date +%Y%m%d-%H%M%S)"
|
||||
|
|
@ -129,6 +130,18 @@ _git checkout --force "$DOTFILES_BRANCH"
|
|||
_git config --local status.showUntrackedFiles no
|
||||
|
||||
|
||||
# Prefer `ssh` for syncing, but only if this machine may have access,
|
||||
# which we proxy with the presence of a default private key file
|
||||
for _key in id_ed25519 id_ecdsa id_rsa; do
|
||||
if [ -f "$HOME/.ssh/$_key" ]; then
|
||||
_git remote set-url origin "$DOTFILES_SSH"
|
||||
echo "The dotfiles now sync via: $DOTFILES_SSH"
|
||||
break
|
||||
fi
|
||||
done
|
||||
unset _key
|
||||
|
||||
|
||||
if command -v batcat >/dev/null 2>&1 && ! command -v bat >/dev/null 2>&1; then
|
||||
ln -sf "$(command -v batcat)" "$XDG_BIN_HOME/bat"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue