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/<target>/` 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/<target>/`
+ 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 <t490s|server>` — shared first-login helper; see
## `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
### `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).
### `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)
`[<date>/<time>/<zone> user@host:path]$` `PS1`, with `PS2`/`PS3`/`PS4`
matching. Colors from `tput`; `\D{...}`/`\u`/`\h`/`\w` instead of forked
`date`/`pwd`. In bash the colors are wrapped in `\[ \]` for readline's
unset after the call. Takes effect because the loop line sits at the very
end of `~/.profile`, after Debian's stock one has sourced `~/.bashrc`
(which sets its own `PS1`), so this fragment gets the last word.
-- `.profile.d/kb` — `kb` alias: `swaymsg 'input * xkb_switch_layout next'`.
+- `.profile.d/kb.sh` — `kb` alias: `swaymsg 'input * xkb_switch_layout next'`.
- `.gitconfig` — minimal `[user]` section.
- `.config/foot/foot.ini` — `font=monospace:size=14.5` and
`login-shell=yes`. The latter is needed because Sway spawns foot with no
arguments, foot spawns `${SHELL}` as a plain interactive shell, and a
non-login shell never reads `~/.profile` — which is where the
- `.profile.d/*` loop lives. No tracked `~/.bashrc` exists to also keep in
+ `.profile.d/*.sh` loop lives. No tracked `~/.bashrc` exists to also keep in
sync.
- `.config/sway/config` — Sway config. Notably `input * xkb_layout "us,de"`
(toggled via `kb`; must stay in sync with `KB_LAYOUTS` in `status.py`) and
is for scripts, `_lib.sh` and `lib/`. A non-script config file a script
reads *in place* from a fixed repo-relative location (like
`to_install/<target>`) gets its own top-level directory.
+- Shell code files that are run or sourced directly from their path (or a
+ symlink to it) end in `.sh`. Exception: commands in `home/user/.local/bin/`,
+ kept suffix-less for terse names in `PATH`. Templates don't count: they
+ aren't run from their own path, and what gets run is their rendered output
+ under whatever name it needs (e.g. `update-efi-hook`, installed as
+ `post-update.d/update-efi`, since `run-parts` skips names with a dot).
- Prefer `templates/` over a new inline heredoc for any file written with
variable substitution; a heredoc long or numerous enough to clutter its
script is the signal. One- or two-line writes with little substitution