From 46b9bacd18d49dd5e246dabd106cbbc583cf976d Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Sun, 16 Aug 2026 23:33:16 +0200 Subject: [PATCH] Add `desktop` branch ... ... that assumes a running GNOME on X11 --- .local/bin/dotfiles-install | 15 ++++++++++++++- README.md | 26 ++++++++++++++++++-------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.local/bin/dotfiles-install b/.local/bin/dotfiles-install index 6f4d997..c88becb 100755 --- a/.local/bin/dotfiles-install +++ b/.local/bin/dotfiles-install @@ -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 diff --git a/README.md b/README.md index 82b0f8c..75c0616 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ If I told you to go here and copy/paste my public `ssh` keys either [here](.ssh/authorized_keys_webartifex) or [here](https://code.webartifex.de/alexander.keys). -Read [this](https://code.webartifex.de/alexander/dotfiles/src/branch/main/.ssh#how-the-keys-are-managed) +Read [this](https://code.webartifex.de/alexander/dotfiles/src/branch/desktop/.ssh#how-the-keys-are-managed) for how the keys are managed. @@ -35,18 +35,28 @@ Read [this](https://code.webartifex.de/alexander/dotfiles/src/branch/main/.ssh#h Simply run: ```sh -curl https://code.webartifex.de/alexander/dotfiles/raw/branch/main/.local/bin/dotfiles-install > dotfiles-install && sh ./dotfiles-install && rm ./dotfiles-install +curl https://code.webartifex.de/alexander/dotfiles/raw/branch/desktop/.local/bin/dotfiles-install > dotfiles-install && sh ./dotfiles-install && rm ./dotfiles-install ``` or ```sh -wget https://code.webartifex.de/alexander/dotfiles/raw/branch/main/.local/bin/dotfiles-install -O dotfiles-install && sh ./dotfiles-install && rm ./dotfiles-install +wget https://code.webartifex.de/alexander/dotfiles/raw/branch/desktop/.local/bin/dotfiles-install -O dotfiles-install && sh ./dotfiles-install && rm ./dotfiles-install ``` This downloads a simple [installation script](.local/bin/dotfiles-install) and then executes it. -The script's only dependency is [`git`](https://git-scm.com/). +Besides [git](https://git-scm.com/), the script assumes + a [Debian](https://www.debian.org/) 13 desktop + with [GNOME](https://www.gnome.org/) 48+ + on [X11](https://www.x.org/), + though older GNOME versions + and [Wayland](https://wayland.freedesktop.org/) should mostly work, + except for some X11-only stuff. +Further, it uses + [`python3`](https://www.python.org/) with `pip` + to generate the [color palette](.local/bin/color-palette) + and enables a few `systemd` user units. So, it should not be too hard to get this going. The repository is cloned as a bare repository into `~/.local/share/dotfiles` @@ -56,12 +66,12 @@ Afterwards, the files can be managed with the [`dotfiles` alias](.config/shell/aliases), for example, `dotfiles status` or `dotfiles pull`. -The above commands install the *main* variant. -To install the *desktop* variant, - switch to the [desktop](https://code.webartifex.de/alexander/dotfiles/src/branch/desktop) branch first. +The above commands install the *desktop* variant. +To install the *main* variant, + switch to the [main](https://code.webartifex.de/alexander/dotfiles/src/branch/main) branch first. Normally, I advise against executing shell scripts from the internet, - but this one is short enough to be read even by beginners. + but this one is still short enough to be read in a few minutes. So, convince yourself that it is not harmful!