From 8ecc0ef38109560453cce745c934dd7f0cebf7a1 Mon Sep 17 00:00:00 2001 From: Plom Heller Date: Fri, 25 Sep 2026 01:33:04 +0200 Subject: [PATCH] Ensure .sh suffix to (most) shell-code files. --- CLAUDE.md | 33 ++++++++++++------- home/any/.profile.d/{aliases => aliases.sh} | 0 .../{hibernation => hibernation.sh} | 0 home/user/.config/sway/config | 2 +- .../{hibernation => hibernation.sh} | 0 home/user/.profile.d/{kb => kb.sh} | 0 home/user/.profile.d/{prompt => prompt.sh} | 0 .../.profile.d/{ssh-agent => ssh-agent.sh} | 0 scripts/lib/link_home.sh | 4 ++- 9 files changed, 25 insertions(+), 14 deletions(-) rename home/any/.profile.d/{aliases => aliases.sh} (100%) rename home/root/.profile.d/{hibernation => hibernation.sh} (100%) rename home/user/.profile.d/{hibernation => hibernation.sh} (100%) rename home/user/.profile.d/{kb => kb.sh} (100%) rename home/user/.profile.d/{prompt => prompt.sh} (100%) rename home/user/.profile.d/{ssh-agent => ssh-agent.sh} (100%) diff --git a/CLAUDE.md b/CLAUDE.md index c53937f..5c6d9a6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -262,11 +262,14 @@ caller) rather than functions reaching for same-named globals. changing the skeleton does *not* refresh existing links; remove a stale link by hand first. The parent `mkdir -p` still runs regardless, so a *new* skeleton file in an already-populated directory still works. - - Appends `for FILE in ${HOME}/.profile.d/*; do . "${FILE}"; done` to - `${HOME}/.profile`, guarded by `grep -qxF`. A loop, because a bare - `. ${HOME}/.profile.*` would source only the first match (further words - become positional parameters); this way a new fragment in `home/any/` or - `home//` never needs a `link_home` edit. + - Appends to `${HOME}/.profile`, guarded by `grep -qxF`, a + `for FILE in ${HOME}/.profile.d/*.sh` loop dot-sourcing each match that + passes `[ -f ]`. A loop, because a bare `. ${HOME}/.profile.d/*.sh` + would source only the first match (further words become positional + parameters); this way a new fragment in `home/any/` or `home//` + never needs a `link_home` edit. Only `*.sh` is sourced, so non-code + files can sit next to the fragments. The `[ -f ]` skips an unmatched + literal glob and dangling links. - Both halves are safe to call repeatedly; `${HOME}` at run time decides whose home is touched. - `start_root ` — shared first-login helper; see @@ -677,11 +680,11 @@ Both scripts share `PATH_GIT_BASE` and (with `install_server.sh`) ## `home/` skeletons All symlinked by `link_home` (see "Shared library"). Profile fragments live -in `.profile.d/` with bare names, sourced by the loop line in `~/.profile`. +in `.profile.d/` as `*.sh`, sourced by the loop line in `~/.profile`. ### `home/any/` (every account) -- `.profile.d/aliases` — the `ls --color=auto` alias, plus `LS_COLORS` filled +- `.profile.d/aliases.sh` — the `ls --color=auto` alias, plus `LS_COLORS` filled via `dircolors -b` (forcing `COLORTERM=truecolor` if unset) when `LS_COLORS` is empty: a shell reached via `su -l` (root's, from the user) loses foot's `COLORTERM`, and `dircolors` has no database entry for foot's @@ -689,7 +692,7 @@ in `.profile.d/` with bare names, sourced by the loop line in `~/.profile`. ### `home/root/` and `home/user/` -- `.profile.d/hibernation` (both, differing) — defines a `hibernate_safe` +- `.profile.d/hibernation.sh` (both, differing) — defines a `hibernate_safe` alias (`command systemctl hibernate || systemctl poweroff`) and shadows a command to steer plain `systemctl hibernate` towards it: `systemctl` itself for root, `sudo` for the user (who only reaches `systemctl` through it). @@ -699,10 +702,10 @@ in `.profile.d/` with bare names, sourced by the loop line in `~/.profile`. ### `home/user/` only -- `.profile.d/ssh-agent` — starts `ssh-agent` and `ssh-add -q` once per +- `.profile.d/ssh-agent.sh` — starts `ssh-agent` and `ssh-add -q` once per login, guarded by `[ -z "${SSH_AGENT_PID}" ]` (so e.g. a second `foot` window doesn't start another). Root needs no agent. -- `.profile.d/prompt` — colored (bold, `COLOR_NUMBER`, default green) +- `.profile.d/prompt.sh` — colored (bold, `COLOR_NUMBER`, default green) `[/