Repository navigation
feat(wallpaper): add Damask first-run setup hook and non-destructive defaults - #1186
Conversation
There was a problem hiding this comment.
The keyfile pre-seed is non-destructive as described (the [[ ! -f "${KEYFILE}" ]] guard at 25-damask-setup.sh:14) and matches the pattern the new docs section describes. One ordering problem and two interactions to flag:
1. This PR fails on its own: damask.service does not exist at main. 25-damask-setup.sh:29 runs systemctl --user enable damask.service under set -euo pipefail (:2), but the unit is only added by #1187 (system_files/bluefin/usr/lib/systemd/user/damask.service). I checked the tree — there is no damask* unit anywhere in system_files/ today. If #1186 merges before #1187, the hook aborts at line 29 on every first login, and because version-script at :7 has already stamped damask-setup user 1 before the body runs (current libsetup.sh semantics), it never retries — the keyfile is written but the service is never enabled, and no later boot fixes it. The body doesn't mention #1187; it should state the dependency, or the enable should be guarded (systemctl --user enable damask.service || true, or checked with list-unit-files like 11-asus.sh:18 does).
2. Not a duplicate of #1187, but both add adjacent lines to .github/workflows/unit-tests.yml (~:123-134) and Justfile (:36-42), so whichever lands second needs a rebase. Related, not conflicting in substance.
3. Interaction with #1196. That PR turns version-script into a read-only gate and requires version-script-commit at the end of the body. This hook has no commit call, so if #1196 lands first this hook re-runs on every login (harmless here thanks to the keyfile guard, but it will re-run systemctl enable each time). The new dconf-consistency.md:135 text "using the version-script contract" would also describe a contract #1196 changes.
Suggested order for a maintainer: #1187 → #1186, with #1186 rebased and either a guard on line 29 or an explicit dependency note.
Confidence: 2/5 (needs attention) — 1 high finding; 1 medium finding
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…defaults Configure first-run user setup hook for Damask (app.drey.Damask) to pre-seed GLib keyfile settings non-destructively: - Set refresh-interval to 86400 (24h), automatic refresh enabled, and run in background. - Set active-source='none' to avoid overwriting GNOME's native timed day/night slideshow until explicitly enabled by user. - Pre-seed slideshow plugin folder URI to /usr/share/backgrounds/bluefin and random sort order. - Enable user unit damask.service via systemctl --user enable. - Guard with version-script damask-setup user 1 and preserve existing keyfile if present. - Add Bats unit test suite and register in Justfile and CI workflow. - Update dconf-consistency skill doc with Flatpak keyfile defaults guidance. Closes #1161 Hive-Run: #1161 Hive-Plan: damask-first-run-setup Hive-Spec: wallpaper-enhancements#1161 Assisted-by: Gemini via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: repires <repires@users.noreply.github.com>
08bfc2f to
813816a
Compare
|
Rebased cleanly onto latest
|
…nce check - Check `systemctl --user list-unit-files damask.service` before calling enable, ensuring the hook safely tolerates environments where damask.service has not yet been installed (such as during independent staging before #1187 merges). - Update Bats test suite with a test verifying graceful skip when the unit is absent.
|
Thank you for the review and catching the ordering nuance! I have addressed the feedback in commit
🐝 Hive Agent: |
The no-op assertion counted all lines in the systemctl mock log, but a single hook run logs two calls: the list-unit-files probe and the enable. The gate was already correct; the assertion could never pass. Count the enable and probe calls separately instead, and drop the trailing blank line that end-of-file-fixer rejected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
|
The keyfile this hook writes is correct. I compiled Damask's real schema and pointed GLib's keyfile backend at the file this hook writes. Every key reads back as intended: I'm holding my approval for one reason: Damask can't see the slideshow folder this hook sets up. This matters more than usual because the hook never overwrites an existing keyfile. Every user keeps whatever folder-uri ships first, even after a later fix. So I'd like the folder-uri to match the path #1187 ends up exposing before this lands. Landing order: #1187 needs to land first. This hook only enables One smaller test fix: in the "non-destructive when keyfile already exists" test, |
hanthor
left a comment
There was a problem hiding this comment.
Thanks for this. A few issues:
25-damask-setup.sh:24:folder-uri='file:///usr/share/backgrounds/bluefin'won't resolve inside the Flatpak sandbox, because/usrthere is the runtime and Damask has no host filesystem access. With ahost-os:rooverride (see my note on #1187), the host path is/run/host/usr/share/backgrounds/bluefin.refresh-interval='86400'is written as a quoted string. If the schema key is numeric, GSettings/keyfile will ignore it. Please check the key types against Damask's schema, and also confirm that'none'is a validactive-source.- The keyfile and
~/.var/app/app.drey.Damaskget created for every user even when Damask isn't installed. Please guard on the app being present. - This depends on the unit from #1187, so either squash the two PRs or land #1187 first. Also note #1196: if that lands, this hook needs
version-script-commit.
|
Status update on Damask setup hook:
Awaiting resolution of #1187 sandbox access and test fix. |
hanthor
left a comment
There was a problem hiding this comment.
The SC2314 fix in the bats test looks right. The hook itself hasn't changed, so the earlier points still stand:
25-damask-setup.sh:23:folder-uri='file:///usr/share/backgrounds/bluefin'isn't visible inside the sandbox. With ahost-os:rooverride it needs to be/run/host/usr/share/backgrounds/bluefin.25-damask-setup.sh:17,20:refresh-intervalis still a quoted string. Please check the key types and the'none'value foractive-sourceagainst Damask's schema.25-damask-setup.sh:9-12: the keyfile and~/.var/app/app.drey.Damaskare still created for users who don't have Damask installed. Please gate onflatpak info app.drey.Damask.- #1187 hasn't changed since my review. Its
filesystems=/usr/share/backgrounds:rooverride still can't work, and this PR depends on it.
hanthor
left a comment
There was a problem hiding this comment.
Thanks. folder-uri now points at /run/host/usr/share/backgrounds/bluefin, which matches the host-os:ro override in #1187.
I checked the key types against Damask's schema, and I was wrong about them. refresh-interval is an enum with a "86400" nick, so the quoted value is correct, and 'none' is a valid active-source (it's the default). No change needed there.
Still open:
25-damask-setup.sh:9-12: the keyfile and~/.var/app/app.drey.Damaskare still created for every user, even when Damask isn't installed. Please gate onflatpak info app.drey.Damask &>/dev/null || exit 0, and put that check beforeversion-scripton line 7. Otherwise a user who installs Damask later never gets the defaults.- This needs #1187 to land first, and #1187 currently needs a rebase.
Gate on flatpak info app.drey.Damask before the version-script call so users who install Damask later still receive default setup.
|
@hanthor Addressed review feedback in commit c7a291c:
|
hanthor
left a comment
There was a problem hiding this comment.
Thanks. 25-damask-setup.sh:7 now exits before version-script when Damask isn't installed, so a later install still gets the defaults, and the new bats case checks that neither the keyfile nor the stamp is written. CI is green. I'm not queueing this yet: #1187 is in the merge queue now, and I'll queue this once it has merged.
bluefin-common PR
What does this change?
Adds a first-run user setup hook for Damask (
system_files/bluefin/usr/share/ublue-os/user-setup.hooks.d/25-damask-setup.sh) that non-destructively pre-seeds GLib keyfile settings forapp.drey.Damask, enables thedamask.servicebackground unit, and adds comprehensive Bats test coverage.Why?
Closes #1161
Damask runs sandboxed as a Flatpak against GKeyfileSettingsBackend at
~/.var/app/app.drey.Damask/config/glib-2.0/settings/keyfile. This setup hook:refresh-interval='86400',enable-automatic-refresh=true, andrun-in-background=true.active-source='none'so Damask remains dormant by default, preserving GNOME's built-in timed day/night wallpaper cycle and user choices until rotation is deliberately enabled.folder-uri='file:///usr/share/backgrounds/bluefin'andsort-by='random'.damask.serviceviasystemctl --user enable damask.service.version-script damask-setup user 1.tests/test_damask_setup.bats) registered inJustfileand CI workflow.docs/skills/dconf-consistency.md.Checklist
fix:,feat:,docs:,ci:,refactor:, etc.)just checkpassespre-commit run --all-filespassesdocs/skills/skill-improvement.md)AGENTS.md/docs/SKILL.md/docs/skills/links remain validAI attribution
Assisted-by: Gemini via GitHub Copilot
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
— hive: backend=agy
🐝 Hive Agent:
contributor| SHA:08bfc2f