fix: fill takes values literally; the notifier path is quoted in its unit

This commit is contained in:
theupriser committed 2026-09-27 16:05:20 +02:00
1 parent cce31e19c2
commit 2e0881b4fa
3 files changed
+11 -6

No files matched your search

+2 -1
View File
@@ -7,7 +7,8 @@ one per merged pull request.
## 2.5.0 - 2026-09-27
- **refactor: DKMS confs in patches/; an existing leds-valve DKMS override is kept and restored**
- **fix: fill takes values literally; the notifier path is quoted in its unit**
- `cce31e1` **refactor: DKMS confs in patches/; an existing leds-valve DKMS override is kept and restored**
- `bd4fa3a` **refactor: The session sync and kernel headers scripts in patches/**
- `8ffa0f2` **refactor: systemd units in services/, read with service_file like patches/**
- `8a2601d` **docs: README screenshot at 2.5.0 with Update notifications; AGENTS.md: retake it when rows change**
+7 -4
View File
@@ -13,12 +13,15 @@ patch_file() { cat "$SCRIPT_DIR/patches/$1"; }
# in. The single-file build replaces service_raw like patch_file.
service_raw() { cat "$SCRIPT_DIR/services/$1"; }
service_file() { local name="$1"; shift; service_raw "$name" | fill "$@"; }
# fill [KEY=value...]: stdin with each @KEY@ replaced by its value (paths,
# names; no "|" in them).
# fill [KEY=value...]: stdin with each @KEY@ replaced by its value, taken
# literally (a home folder may contain sed's "&", "\" or "|").
fill() {
local kv
local kv v
local -a subst=(-e '')
for kv in "$@"; do subst+=(-e "s|@${kv%%=*}@|${kv#*=}|g"); done
for kv in "$@"; do
v="${kv#*=}"; v="${v//\\/\\\\}"; v="${v//&/\\&}"; v="${v//|/\\|}"
subst+=(-e "s|@${kv%%=*}@|$v|g")
done
sed "${subst[@]}"
}
warn() { echo -e "${c_yellow}[WARN]${c_reset} $*"; }
+2 -1
View File
@@ -8,7 +8,8 @@ PartOf=graphical-session.target
Type=simple
# The short wait at login lets the tray come up first (in the script: an
# ExecStartPre sleep runs into the start timeout).
ExecStart=@NOTIFY_SCRIPT@ --delay 60
# Quoted: the path is in the home folder, which may contain a space.
ExecStart="@NOTIFY_SCRIPT@" --delay 60
[Install]
WantedBy=plasma-workspace.target