Registered Member
|
I have some video files on the desktop for test purpose. I want to add some custom right mouse items.
I created ~/.local/share/kio/servicemenus/shell.desktop
Item "runC" is above "runY". It seems to sort alphabetical. Also tried with 2 separate files ~/.local/share/kio/servicemenus/shellA.desktop
and ~/.local/share/kio/servicemenus/shellB.desktop
How to custom sort (at least) my items? And can i also add a divider? (just a stripe to segregate some items) |
Registered Member
|
It now confused me even more. Following https://develop.kde.org/docs/extend/dol ... ice-menus/
And also detected "desktop-file-validate" but the example seems broken also desktop-file-validate ~/.local/share/kio/servicemenus/shellA.desktop ~/.local/share/kio/servicemenus/shellA.desktop: error: required key "Name" in group "Desktop Entry" is not present ~/.local/share/kio/servicemenus/shellA.desktop: error: key "MimeType" is present in group "Desktop Entry", but the type is "Service" while this key is only valid for type "Application" ~/.local/share/kio/servicemenus/shellA.desktop: error: key "Actions" is present in group "Desktop Entry", but the type is "Service" while this key is only valid for type "Application" |
Registered Member
|
As for the alphabetical order, or which one you want to show first, just rename the action name. If you want that runY before runC in the menu, rename the desktop action to, for example, arunY.
Not sure why you want to add servicemenus to kio. If it's just for a custom servicemenu on a video type file, put them in ~/.local/share/kservices5/ServiceMenus. As a servicemenu, it's totally incomplete. You want two actions in one line. Doesn't work, you'll need a submenu. At least, if you want that toplevel. Something like: [Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin MimeType=video/*; Actions=arunY;runC; X-KDE-Priority=TopLevel X-KDE-Submenu=**** Encoding=UTF-8 [Desktop Action arunY] Name=runY Icon=question Exec=~/bin/script.sh 'runY' '%u' InitialPreference=50 SortOrder=50 [Desktop Action runC] Name=runC Icon=emblem-favorite Exec=~/bin/script.sh 'runC' '%u' InitialPreference=40 SortOrder=40 Looks like: https://imgur.com/a/OoGRrBq
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
Ahh , i kept the "Name" and the "ActionName" in sync. I now prepended a number to the wanted order. Thanks!.
You option creates a submenu and i want to have a couple of items directly in the right-button menu and this works with KIO. The "desktop-file-validate" seems to complain unfairly because it works just fine it seems. Removed all "SortOrder" and "InitialPreference" because it does not seem to do anything. Not sure how to add a divider/separator. Something i have to accept i guess. |
Registered Member
|
If you want separate items, do it without submenu. Again, you don't need kio to get separate actions.A sub just takes less space. If it's just two actions, do them apart. If you'd have more options, do a sub cause it gets overcrowded real fast. https://imgur.com/a/gxo6skw
If you want that desktop complain, keep them in kio. If not, do it the proper way in ~/.local/share/kservices5/ServiceMenus. No, no separator. Wether you make services yourself or through a menu-install or deb or script, they go in the ~/.local/share or /usr/share directory but not in kio. The simple and the elaborate ones equally. https://imgur.com/a/aE8V3bu
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
Even with your location " ~/.local/share/kservices5/ServiceMenus" the "desktop-file-validate" tool gives errors
key "MimeType" is present in group "Desktop Entry", but the type is "Service" while this key is only valid for type "Application" So probably a bug. I think there is also a misunderstanding. I do not mind to use one ".dekstop" file or multiple. But i want multiple items and divide some, so a "line" like: https://i.stack.imgur.com/F1uyH.png Also not sure why "%d" and "%D" are deprecated (or even what the difference is between those 2). Guess they want me to extract the folder part myself. Luckily it still works at this moment. Currently using
To be honest. I currently use Thunar and adding items was really easy via the GUI. Entering some "dashes" to make a separator. But the refuse/don't know how to fix the "random selecting items" bug so it frustrates my workflow. TLDR; I now have a working menu but the validation tool seems flawed. Out of date information,deprecated properties, marking things as "errors" but applying them anyway does not make thing easy to use. |
Registered Member
|
You could've started with "I use thunar". As for the difs between %d and %whatever, they're explained in thunar when you add custom entries.
In the screenshot I posted I split up your two commands instead of in a submenu. I don't have to use anything special if I want a multiple selection of files, regardless if there's a space, number, sign.. in the name file or whatever. Here's an example to select a bunch to rename using krename https://imgur.com/a/iyBnjqu: [Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin MimeType=all/all; Actions=Rename; X-KDE-Priority=TopLevel X-KDE-StartupNotify=false Icon=document-sign [Desktop Action rename] Icon=document-sign Name=KayName Name[en]=KayName Exec=krename -r %U If, even by the service menus I provided it STILL pops up an error, then it's due to your script, not by the nature of the service menu. This is an example to use a script to toggle a tiler layout, no error whatsoever. And I have a couple of those. [Desktop Entry] Type=Service Icon=align-vertical-top X-KDE-ServiceTypes=KonqPopupMenu/Plugin MimeType=all/all; Actions=ToggleTiler X-KDE-Priority=TopLevel #X-KDE-Submenu= Encoding=UTF-8 [Desktop Action ToggleTiler] Name=ToggleTiler Icon=align-vertical-top Exec=/home/john/Scripts/Toggle It calls for this script: #!/bin/bash current=`kreadconfig5 --file kwinrc --group Plugins --key bismuthEnabled` if [ $current = "true" ]; then kwriteconfig5 --file kwinrc --group Plugins --key bismuthEnabled false elif [ $current = "false" ]; then kwriteconfig5 --file kwinrc --group Plugins --key bismuthEnabled true fi qdbus org.kde.KWin /KWin reconfigure What's your script supposed to do anyway?
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
I have to say: as a user that has hundreds of custom servicemenu entries in various submenus defined in dozens of .desktop files...... needing to number them SUCKS. It would be far easier to have an index defined. [FEATURE REQUEST] eg: [Desktop Action generateAudioWaveformImage] Index=008 Icon=media-optical-mixed-cd Name=generate - audio waverform IMAGE Exec=konsole --noclose -e /home/user/documents/scripts/audio/generate-audioWaveformImage.sh %U Also; how do we position _SEPARATOR_(s) ? Also; how do we position top level menus ? Why do devs need to continuously break little things that are core, and developed by the user over long periods of time but are tedium for the user to fix? |
Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]