A small collection, because reasons.
To apply these, place the .desktop file you're interested in in ~/.local/share/kservices5/ServiceMenus/
, then run kbuildsycoca5
(failures are ok).
For each of them, the binary in question (specified under TryExec=) must be in the systemwide $PATH
.
You can expand it in the plasma5 env files, or via PAM.
Or just, you know, symlink it into /usr/local/bin
.
Optionally, you can download/place a compliant icon into ~/.local/share/icons/
.
E.g when Icon=asciidoctor
is specified, you can place an asciidoctor.png
in that directory.
These are some useful notes for people that want to write their own.
- this is the list of supported X-KDE extension keys I could find, see
KIO/src/widgets/kfileitemactions.cpp
X-KDE-Priority
(pin to top, per .desktop file)X-KDE-Submenu
(place everything in a submenu, per .desktop file, multiple files can share the same submenu)X-KDE-ShowIfRunning
(does something weird with dbus, idk)X-KDE-ShowIfDBusCall
(I REALLY don't know)X-KDE-Protocol
andX-KDE-Protocols
(no clue)X-KDE-Require
(all this seems to do is if you have "Write" in there, it makes sure you can write to the file?)X-KDE-RequiredNumberOfUrls
(if you set it to 2, you need to have 2 files selected for it to show up in the menu, etc)X-KDE-GetActionMenu
|Actions
|ServiceTypes
|MimeType
- these are all kinda bundled togetherX-KDE-ServiceTypes
basically a combination ofServiceTypes
andMimeType
, but with,
separators
- TryExec does work, but it's on a per-file basis. I looked at it, and to enable it on a per-action basis you'd basically need to patch two components (KService, to extend KServiceAction to have a tryexec() func, and then plug that in / add-in a isValid() to it too. Then you'd need to make KIO use that in
KDesktopFileActions::userDefinedServices()
to skip over the invalid ones.
Consider all of these licensed under the unlicense.