Skip to content

[ryoku] dolphin: Set as Wallpaper through ryogami, add the picture to the library - #944

Merged
neur0map merged 8 commits into
Ryoku-dev:unstable-devfrom
cbaugus:dolphin-set-wallpaper
Nov 30, 2026
Merged

neur0map merged 8 commits into
Ryoku-dev:unstable-devfrom
cbaugus:dolphin-set-wallpaper

Conversation

@thenomadops

@thenomadops thenomadops commented Nov 22, 2026 •

Copy link
Copy Markdown

What changed

Right-clicking a picture in Dolphin and choosing Set as Wallpaper fails on a Ryoku session with:

An error occurred while attempting to set the Plasma wallpaper: The name is not activatable

That action is Plasma's wallpaperfileitemaction (from plasma-workspace). It asks org.kde.plasmashell over D-Bus, and on Ryoku there is no Plasma shell to answer.

This PR:

  • adds ryogami wallpaper import <path> (ryoku/shell/ryogami/daemon/library_import.go). It copies a picture into the library dir the picker scans, or a clip into the video dir, then sets it like set. Without this, a picture set from Dolphin never showed up in the wallpaper picker. A file already in the library stays where it is, an identical copy is reused, an existing file is never overwritten (name-1.ext instead), and the copy goes through a hidden temp name so the library watcher never sees a half-written file. With performance.autoOptimizeImages on, the existing optimizer then re-encodes the import like any other new library picture.
  • adds ryoku/apps/dolphin/ryoku-set-wallpaper.desktop, a KIO service menu for image types that runs ryogami wallpaper import %f
  • adds ryoku/apps/dolphin/kservicemenurc ([Show] wallpaperfileitemaction=false), which hides Plasma's broken action so the menu shows one wallpaper entry
  • ryoku-desktop installs both system-wide, to /usr/share/kio/servicemenus/ and /etc/xdg/kservicemenurc. The second is an XDG system default, so a user's own ~/.config/kservicemenurc still overrides it
  • the dev loop (ryoku/shell/deploy.sh) installs the menu per user (executable, as KIO requires for user service menus) and sets the hide key with kwriteconfig6 without overwriting the user's file
  • the nix data package ships both files
  • tests/payload-parity.sh checks that all four editions (arch, void, fedora, fedora-spec) ship both files byte for byte
  • ryoku/apps/dolphin/README.md, docs/ryogami.md, the command catalog entry, and a ryoku/CHANGELOG.md entry

Area

ryoku

How it was tested

On a running Ryoku 1.1.0 box (Hyprland, Dolphin with plasma-workspace 6.8.3 installed):

  • Reproduced the error with the stock menu.
  • Installed the service menu and the hide key, then restarted Dolphin (including dolphin --daemon). The context menu shows a single Set as Wallpaper, and clicking it sets the wallpaper: ~/.local/state/ryoku-wallpaper points at the clicked picture.
  • Before the restart both entries appeared. Dolphin reads kservicemenurc only at startup.
  • Review follow-ups (f0301d2, fc75c34): chunked compare, O_EXCL fallback when there are no hard links, retry on a name claimed mid-import, an in-place check that mirrors the scanner, no JPEG XL in the menu, and a checkout deploy that respects the user's own kservicemenurc. Each new test failed before its fix. Mutants that drop O_EXCL, stop the compare after one chunk, or skip the hidden-path rule each fail a test.
  • library_import_test.go (13 cases) failed before the implementation and passes after. Disabling the in-library check, or the identical-copy reuse, each fails a test. A mode check caught the copy coming out 0600 instead of 0644, which is now fixed.
  • Live: ran this branch's ryogami as the daemon and ran ryogami wallpaper import ~/Downloads/<photo>.jpg. The photo was copied into ~/Pictures/Wallpapers and set, and it shows up in the wallpaper picker. A second import left one file. import /etc/hostname is refused with "not an image or video the library shows". go vet is clean and go test ./... passes for ryogami.
  • tests/payload-parity.sh passes. With the kservicemenurc install removed from payload.sh, it fails with ryoku-desktop arch package does not hide Plasma's wallpaper action.
  • bash -n passes on the touched scripts. Commit hooks ran (core.hooksPath .githooks), no --no-verify.

Checklist

  • One logical change, with a clear [area] scope: summary commit subject.
  • Matching CHANGELOG.md updated in the area I touched.
  • The git hooks pass locally; I did not use --no-verify.
  • Lua parses (luac -p), shell scripts pass bash -n, and QML passes qmllint where applicable.
  • No duplicated config, no dead code, no commented-out code, no em-dash.
  • Docs updated if behavior or layout changed.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with a non-blocking failure for long filenames on drives without hard links.

Fix All in Claude CodeFindings

  1. P2 Long filenames fail to import ▶
Fix with agent prompt
### Issue 1
ryoku/shell/ryogami/daemon/library_import.go:229-230
**Long filenames fail to import.** On an exFAT library drive, a valid 250-character ASCII filename reaches this fallback, but adding `.import-claim-` makes the claim name 264 characters long. Creating it fails with “file name too long,” so the picture is neither imported nor applied. Use a bounded name derived from the destination, such as a hash, for the claim file.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds a Dolphin action that imports a picture into the wallpaper library before applying it. The follow-up keeps unfinished copies hidden on drives without hard links and avoids changing Plasma’s menu settings.

  • Ryogami imports a picture into its library and sets it.
  • Dolphin's Set as Wallpaper action applies the picture in Ryoku.

Reviews (11) · Last reviewed commit: "[ryoku] ryogami: hide the import claim, ..." · Reviewed by Greptile

@neur0map neur0map left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Changes requested — 0 critical and 1 major issue(s): see the inline comments and the walkthrough for fixes and an agent-ready prompt.

Comment on lines +1 to +5
[Desktop Entry]
Type=Service
MimeType=image/jpeg;image/png;image/webp;image/gif;image/bmp;image/avif;image/jxl;image/tiff;
Actions=setRyokuWallpaper;
X-KDE-Priority=TopLevel

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 minor · Possible Bug · fix: high effort

The service menu is installed system-wide without a desktop restriction, and the system default also hides Plasma's action. A user running a Plasma session on the same installation will therefore lose Plasma's working wallpaper action and be offered the Ryoku command instead. Scope both the replacement and the hide setting to Ryoku sessions.

Reply here to discuss, say it's fixed, or explain why it's intended — no mention needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is real on a box with both sessions. I looked into it: KService does honour NotShowIn (so NotShowIn=KDE; could hide the Ryoku entry under Plasma), but the hide setting is the harder half. KConfig only reads kservicemenurc from XDG_CONFIG_HOME and XDG_CONFIG_DIRS, and nothing Ryoku-specific sits on that path: ryoku-wayland-session wraps Plasma's sessions too, 98-ryoku-dbus.conf applies to every systemd user session, and apps launched from compositor binds inherit the compositor's environment rather than ryoku-host session start's. Scoping it properly means a Ryoku-session-only XDG_CONFIG_DIRS entry (for example /usr/share/ryoku/xdg-config) prepended by each provider (Hyprland hl.env, niri environment {}, Wayfire's launcher), with the doctor and delivery checks following. That is a cross-provider change, so I'd rather not fold it into this PR. Happy to do it here or as a follow-up if you'd prefer; until then a Plasma user can turn Plasma's action back on in Dolphin > Configure > Context Menu, which overrides the system default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address this in the PR, or leave the system-wide menu and hide setting out until session scoping is ready. The current entry has no desktop restriction, and asking Plasma users to restore their action manually leaves the regression in place. A follow-up is fine if this PR doesn't ship the conflicting defaults.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6f2dc7d, following the option you offered. The entry now has NotShowIn=KDE;, and the system-wide kservicemenurc is gone from the deb/arch/fedora/nix payloads and from the checkout deploy, so a Plasma session keeps Plasma's working action. Ryoku sessions list both entries until a Ryoku-only config path exists; the README says how to switch Plasma's off. Test TestDolphinMenuStaysOutOfPlasmaSessions failed before and passes; payload-parity now asserts the file is not shipped.

Comment thread ryoku/shell/deploy.sh Resolved
@neur0map

neur0map commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

🦊 mika's review

Incremental review: new commits since the last checkpoint.

Summary

  • Route Dolphin's wallpaper action through Ryogami instead of Plasma.
  • Import images and videos into the picker library before applying them.
  • Ship the Dolphin integration in native packages and checkout deployments.
  • Cover import collisions, scanner visibility, and package payload parity.

Change diagram

flowchart LR
  Dolphin["Dolphin service menu"] --> Import["Ryogami import"]
  Import --> Library["Wallpaper or video library"]
  Import --> Apply["Apply wallpaper"]
  Package["Desktop package and checkout deploy"] --> Dolphin
  Package --> Config["Plasma action visibility default"]
Loading

Estimated review effort: 3/5 · risk: medium

📁 Walkthrough details

ryoku/shell/ryogami/daemon/library_import.go

  • Adds library imports for supported images and videos, reusing listed files and identical copies.
  • Avoids overwriting existing names and handles hidden paths, symlinks, and filesystems without hard links.
    • Compares files in bounded chunks and retries names claimed during import.
    • Publishes through a hidden temporary file when hard links are available; the fallback copies to an exclusively created destination.

ryoku/shell/ryogami/daemon/verbs.go

  • Adds the wallpaper import verb, then applies the retained library file to the selected targets.
    • Validates the path and reports import or application errors.

ryoku/shell/ryogami/daemon/main.go

  • Adds wallpaper import and its screen option to CLI usage.
    • Updates the command synopsis.

ryoku/shell/ryogami/daemon/library_import_test.go

  • Tests import placement, reuse, collision handling, scanner visibility, and unsupported inputs.
  • Checks the hard-link fallback, chunked comparison, and Dolphin MIME mappings.
    • Covers racing imports, hidden files, and symlinked paths.

ryoku/apps/dolphin/ryoku-set-wallpaper.desktop

  • Adds a top-level Dolphin action that imports and applies supported images through Ryogami.
    • Runs ryogami wallpaper import %f for declared image MIME types.

ryoku/apps/dolphin/kservicemenurc

  • Hides Plasma's wallpaper action by default in Ryoku sessions.
    • Sets wallpaperfileitemaction=false.

release/packages/ryoku-desktop/payload.sh

  • Installs the Dolphin service menu and system-wide visibility default in the desktop package.
    • Ships the menu under KIO and the default under /etc/xdg.

nix/packages/ryoku-desktop-data.nix

  • Includes the Dolphin service menu and visibility default in the Nix desktop data package.
    • Installs both integration files into the package output.

ryoku/shell/deploy.sh

  • Deploys an executable user service menu and sets the Plasma visibility key when no choice exists.
    • Uses KDE configuration tools without replacing the user's configuration file.

tests/payload-parity.sh

  • Checks that Arch, Void, Fedora, and Fedora spec payloads contain both Dolphin integration files.
    • Compares staged files byte-for-byte with repository sources.

docs/ryogami.md

  • Documents importing, applying, reusing, and collision-renaming wallpaper files.
    • Explains how Dolphin imports appear in the picker.

ryoku/apps/dolphin/README.md

  • Documents the Dolphin action, Plasma failure, installation paths, and user override.
    • Notes that Dolphin reads the integration at startup.

ryoku/shell/quickshell/keys/commands/catalog/ryoku-cli.json

  • Adds ryogami wallpaper import to the command catalog.
    • Describes importing and applying an image or video.

ryoku/CHANGELOG.md

  • Records the Dolphin wallpaper fix and library import behavior.
    • Notes that Plasma's action is hidden by default.

Findings

Severity Category Fix effort File Issue
🟠 major data_integrity medium ryoku/shell/ryogami/daemon/library_import.go Data Integrity — On filesystems without hard links, the fallback exposes dest while copying into it. A library scan during a slow copy can process an incomplete image, including through automatic optimization. Publish the completed tem…

⚡ Quick fixes by effort

Medium effort (a function-level change):

  • ryoku/shell/ryogami/daemon/library_import.go:210 — Data Integrity — On filesystems without hard links, the fallback exposes dest while copying into it. A library scan during a slow copy can process an incomplete image, including through automatic optimization. Publish the completed tem…
🤖 Prompt for AI agents (click, copy, paste into Claude/Codex)
Fix the following issues found by mika-agent on Ryoku-dev/ryoku#944 (branch dolphin-set-wallpaper):

- ryoku/shell/ryogami/daemon/library_import.go:210-216 — Data Integrity (major severity, medium effort): On filesystems without hard links, the fallback exposes `dest` while copying into it. A library scan during a slow copy can process an incomplete image, including through automatic optimization. Publish the completed tem…

For each: verify it is real in the current code, apply the smallest correct fix, and run the repo's tests. Skip anything already resolved and say why.
🛠 Deterministic checks run
  • golangci-lint: not installed (skip)
  • shellcheck: not installed (skip)

🚦 Merge recommendation: changes_required


🦊 Generated by Mika — the Ryoku org's self-hosted AI code reviewer. Machine findings: verify before merging.

@neur0map neur0map added area:ryoku Ryoku project area type:bug A reported problem labels Nov 22, 2026
@thenomadops thenomadops changed the title [ryoku] dolphin: set wallpaper through ryogami, hide Plasma's action [ryoku] dolphin: Set as Wallpaper through ryogami, add the picture to the library Nov 22, 2026

@neur0map neur0map left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Changes requested — 0 critical and 2 major issue(s): see the inline comments and the walkthrough for fixes and an agent-ready prompt.

Comment thread ryoku/shell/deploy.sh Resolved
Dolphin's Set as Wallpaper comes from plasma-workspace and asks the
Plasma shell over D-Bus, so on a Ryoku session it fails with "The name
is not activatable". Ship a KIO service menu that runs ryogami wallpaper
set instead, and a system kservicemenurc that hides Plasma's action.

Note: Fixed: Dolphin's Set as Wallpaper now sets the Ryoku wallpaper instead of failing with a Plasma error
Setting a picture from Dolphin left it outside the wallpaper folder, so
the picker never listed it. ryogami wallpaper import copies the picture
into the library dir the picker scans (videos to the video dir), then
sets it. A library file stays put, an identical copy is reused, and a
different file with the same name is kept beside it. The Dolphin menu
now calls it.

Note: New: ryogami wallpaper import adds a picture to the wallpaper library and sets it; Dolphin's Set as Wallpaper uses it
Review follow-ups. The duplicate check read both files whole, so
re-importing a large clip could exhaust the daemon's memory; it now
compares in 64 KiB chunks. On filesystems without hard links the
fallback renamed over a file that appeared mid-import; it now creates
the destination exclusively. A name claimed by another import is weighed
again (reused if identical, else the next name) instead of failing. The
checkout deploy only hides Plasma's action while the user has not set
that key, so a deliberate choice survives redeploys.
@thenomadops
thenomadops force-pushed the dolphin-set-wallpaper branch from 66635bb to f0301d2 Compare November 22, 2026 21:17
@thenomadops
thenomadops changed the base branch from main to unstable-dev November 22, 2026 21:17

@neur0map neur0map left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Review findings — 2 blocking issue(s): see the inline comments and the walkthrough for details.

@neur0map
neur0map dismissed stale reviews from themself November 22, 2026 21:19

Blocking findings were addressed (verified at f0301d253c).

A still in the video dir, a file under a hidden folder, or a symlink in
the library was treated as already listed and never copied, though the
scanner skips all three. The in-place check now mirrors collectMedia's
filters, and a symlink holding a name is never reused. The Dolphin menu
no longer offers JPEG XL, which the library does not show; a test keeps
its MIME list in step with the library's image types.

@neur0map neur0map left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Changes requested — 0 critical and 1 major issue(s): see the inline comments and the walkthrough for fixes and an agent-ready prompt.

A source named like .photo.jpg was copied under its hidden name, which
the scanner skips, so it still never reached the picker; the copy now
drops the leading dots. A file reached through a symlinked folder in
the library counted as listed, but WalkDir does not follow folder
symlinks, so the in-place check now refuses any symlinked folder on the
way to the file.

@neur0map neur0map left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Changes requested — 0 critical and 1 major issue(s): see the inline comments and the walkthrough for fixes and an agent-ready prompt.

Comment on lines +210 to +216
// FAT, exFAT and some FUSE mounts have no hard links. Exclusive create
// still refuses a taken name; the file is just visible while it fills.
out, err := os.OpenFile(dest, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o644)
if err != nil {
return err
}
if err := copyInto(out, tmp.Name()); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 major · Data Integrity · fix: medium effort

On filesystems without hard links, the fallback exposes dest while copying into it. A library scan during a slow copy can process an incomplete image, including through automatic optimization. Publish the completed temporary file atomically without replacing an existing destination.

Reply here to discuss, say it's fixed, or explain why it's intended — no mention needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6f2dc7d. The fallback no longer creates dest early: it holds the name with a hidden .import-claim-<name> file (O_EXCL, ignored by the library walk), checks dest is still free, then renames the finished copy onto it. Nothing is ever visible empty or partial. A claim left by a dead import makes the next name get used rather than spinning. Test TestImportWithoutHardLinksNeverExposesAnEmptyDestination failed before (dest existed empty at rename) and passes now; ...SkipsAStaleClaim covers the dead-claim case.

The daemon resolved a relative import path against its own working
directory, so ryogami wallpaper import photo.jpg found the wrong file or
none; the client now resolves it before sending. A real read error in
the duplicate check is returned instead of read as a mismatch. Without
hard links the copy now finishes under its hidden temp name and is
renamed over an exclusive placeholder, so a scan never sees it half
written and a taken name is still refused.
@neur0map

Copy link
Copy Markdown
Member

I've reviewed 5 pushes on this PR automatically, so I'll stop doing full passes here and only check whether open threads get fixed. Add the mika:review label or comment @ryoku-mika review for another full review.

@Sipper1236 Sipper1236 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The importer is a good addition, but the no-hardlink path exposes an empty destination between the exclusive claim and rename, so the watcher can pick it up incomplete. Also, the system-wide KIO setting hides Plasma’s working action outside Ryoku; please scope that override to Ryoku sessions.

Note: Fixed: Dolphin's Set as Wallpaper no longer hides Plasma's action in Plasma sessions
@thenomadops

Copy link
Copy Markdown
Author

Round update at 6f2dc7d: the no-hard-link fallback now holds the name with a hidden claim file and renames the finished copy in, so nothing is ever visible empty; the Dolphin entry is NotShowIn=KDE; and no system-wide kservicemenurc ships, so Plasma sessions keep Plasma's action. Declined: the compositors list in ryoku-cli.json (it matches every sibling entry).

Comment on lines +229 to +230
claimPath := filepath.Join(filepath.Dir(dest), ".import-claim-"+filepath.Base(dest))
claim, err := os.OpenFile(claimPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o644)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Long filenames fail to import. On an exFAT library drive, a valid 250-character ASCII filename reaches this fallback, but adding .import-claim- makes the claim name 264 characters long. Creating it fails with “file name too long,” so the picture is neither imported nor applied. Use a bounded name derived from the destination, such as a hash, for the claim file.

Prompt To Fix With AI
This is a comment left during a code review.
Path: ryoku/shell/ryogami/daemon/library_import.go
Line: 229-230

Comment:
**Long filenames fail to import.** On an exFAT library drive, a valid 250-character ASCII filename reaches this fallback, but adding `.import-claim-` makes the claim name 264 characters long. Creating it fails with “file name too long,” so the picture is neither imported nor applied. Use a bounded name derived from the destination, such as a hash, for the claim file.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

@neur0map
neur0map merged commit da83478 into Ryoku-dev:unstable-dev Nov 30, 2026
2 checks passed
@neur0map

Copy link
Copy Markdown
Member

Thanks for the work here, merged and renamed the entry to Set as Ryoku Wallpaper so it doesn't clash with KDE's, next update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ryoku Ryoku project area type:bug A reported problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants