Bug 507910 - Impossible to call kritarunner in AppImage and Snap
Summary: Impossible to call kritarunner in AppImage and Snap
Status: RESOLVED LATER
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: 5.2.11
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-05 17:55 UTC by Geekley
Modified: 2025-08-22 15:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geekley 2025-08-05 17:55:19 UTC
SUMMARY
There should be a way to specify the binary to run when packaged via AppImage. Specifically the kritarunner command, which I believe is impossible to run currently.
This post shows how it can be implemented - ideally you would do both:
1. Via checking the `$ARGV0` environment variable and calling the corresponding binary - this would allow a symlink be made for kritarunner. See: https://discourse.appimage.org/t/call-alternative-binary-from-appimage/93/10
2. Via some command-line flag passed to AppRun (or even the `krita` command itself) that would do the same, e.g. `krita.AppImage --kritarunner --help`

STEPS TO REPRODUCE
1. Download the AppImage and make a symlink to it on same folder called `kritarunner`
2. Run `kritarunner --help`

OBSERVED RESULT
It shows the result of `krita --help`, with no apparent option to run kritarunner.

EXPECTED RESULT
Being able to run kritarunner somehow. Both through symlink and some flag like `--kritarunner`.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 25.04
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.3
Kernel Version: 6.14.0-27-generic (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
AppImage (unfortunately?) doesn't have a standard way to run other binaries (like the proposed `--appimage-exec` flag), and it seems like it won't be implemented, as their vision seems to be that it's up to the app developer to opt-in to expose this via e.g. a custom AppRun script or in the payload main app binary.

I don't know much about AppImages, but I've also tried mounting the AppImage with `--appimage-mount` and running the binary directly, but it doesn't work - which is understandable as presumably they were never intended to be run this way (?).
Comment 1 Geekley 2025-08-05 20:13:10 UTC
This bug also happens on Snap.
`snap run krita.kritarunner --help` gives `error: cannot find app "kritarunner" in "krita"`.
In fact, `snap info krita` only lists `krita` under commands, no `kritarunner`.
Not even this works: `snap run --shell krita -c 'kritarunner "$@"' /bin/bash --help`, as kritarunner is not listed in bin. It does work for `krita_version`, though.

At least the Flathub version works fine: `flatpak run --command=kritarunner org.kde.krita --help`
Comment 2 Halla Rempt 2025-08-22 10:30:47 UTC
Yes, well, this isn't supposed to work, I'm afraid. I don't think we can make it work, other than by making a second appimage that starts krita-runner. The kritarunner executable also is in a pretty bad state, so I'm not sure how much effort we should put into this.
Comment 3 Geekley 2025-08-22 15:56:03 UTC
It's already explained how it can be made to work on AppImage in the link, you just use a custom AppRun, a very simple script that checks ARGV0 and passes the arguments to the right executable. It's already in the AppImage, it just needs to be accessible.
And on Snap, just include it and expose the command. Both changes should be very simple to make.

Please reconsider, because `kritarunner` is a workaround for the `krita` CLI bug that freezes when the GUI is open (bug #460631). That bug makes it unusable. This doesn't happen when using kritarunner CLI to convert images (yes, kritarunner is not perfect, but it's the only reliable way to do batch processing in Krita, and to support the KRA format in scripting or integrated from other apps).