I recently wanted to find a good set of service menus for basic batch image manipulation in Dolphin. Reimage (https://www.egregorion.net/, KDE 5 Service Menu ReImage - KDE Store) seemed to be the best option, but when I tried installing it, it just failed silently. Even manually downloading the files and moving them into place manually failed silently.
On investigating it with
desktop-file-validate, it turns out the .desktop files were full of errors on modern KDE. I couldn’t find any good documentation for the .desktop file format (Creating Dolphin Service Menus | Developer was very surface level and Desktop Entry Specification was missing a lot of stuff) so ended up tweaking the .desktop files until they did work.
Now I’m trying to package it up again in a format where people can actually install and use it successfully, and I have some questions:
- Is there a different, modern, better-maintained extension which does the same thing, which I have somehow missed and should use instead? If not:
- Is there a way of inserting separators into custom context menus? The old .desktop files used
Actions=key, but the validator complained about the underscores not being valid, and the service menus only worked when I removed these entries. I can’t find any documentation about menu separators anywhere
- What is the correct location for installing the .desktop files? The guide I linked above suggests
~/.local/share/kio/servicemenus, which does work for me. However the (non-functional) installer script calls
kf5-config --path servicesto find a location. On my kubuntu machine, this has the following output:
/home/barnaby/.local/share/kservices5/:/usr/share/kservices5/. The first location listed doesn‘t exist, the second value is deprecated according to the guide I linked above, and the working location I actually use isn’t there at all. This is very confusing.
- What is the correct location for installing the binary which actually does the work and is called from the service menu
Execkeys? The installer tries to put it in
$HOME/bin, which doesn’t exist on my machine and isn’t in my
$PATHso wouldn’t work anyway. When the binary is in
~/.local/share/bin, I can run it in my terminal but it can’t be called from dolphin. I ended up putting it in
/usr/local/bin/— is this a reasonable and generalizable decision?
- Is there a way for service menus to declare dependencies? Is it as simple as putting an
apt-get installcommand in the install script (which would only work on Debian-derived systems)? What are the best practices for this? Currently the plugin just makes dialog boxes saying “Couldn’t find software x, please install it!” when you try to do anything with it. Would be nice to either do this automatically or at least do the checks earliest on install rather than on use.
desktop-file-validatecomplains about errors even on working service menu files. It doesn‘t seem to differentiate between warnings and errors, and it complains about many things which are apparently required for KDE service menus to work (e.g. Services having an Exec key). What’s up with that?
- Why has what’s permissable in the .desktop format changed so much, apparently with no consideration for back compatibility? It looks like at some point underscores were suddenly no longer accepted within desktop action IDs (and
_SEPARATOR_disappeared or changed with them), which broke this very popular plugin. Why?
- It’s possible to install custom servicemenus and plugins via Discover and Dolphin, but it doesn’t look like there’s any way to specify which versions of KDE the service works with, and no user-facing way of debugging issues. Before I started digging around, I tried every user-facing GUI method of installing the service menu I could find, and all failed silently. When I moved the files into place myself, it failed silently. Are there any plans to improve this situation so that it might be usable for people who aren’t prepared for and capable of spending hours digging into the weeds so that they can right click on some images and make them smaller? I am happy to file bug reports with specific suggestions if they’re welcome. I love how easy KDE can (or in this case could) make it to do cool customizations like this but all these issues are very demoralizing.
System version information:
Operating System: Kubuntu 23.10
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.0-14-generic (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® Graphics