2

Is it possible to create lower levels of sub-menus in Dolphin context menu than the one created by the line X-KDE-Submenu= under [Desktop Entry]?


Example:

I have created an action called "Subtitles" (X-KDE-Submenu=Subtitles) which contains 4 options for downloading different languages with the filebot tool. I know I can make that appear in the top level or under Actions. I have set it for toplevel with the line X-KDE-Priority=TopLevel.

[Desktop Entry]
Type=Service
Name=Download subtitles (filebot)
ServiceTypes=KonqPopupMenu/Plugin
Actions=en;fr;ro;it;
MimeType=video/*
Icon=gnome-subtitles
Encoding=UTF-8
X-KDE-Priority=TopLevel
X-KDE-Submenu=Subtitles

[Desktop Action en]
Exec=filebot -get-subtitles -rename -non-strict %f
Icon=gnome-subtitles
Name=English (filebot)
Termial=true

[Desktop Action fr]
Exec=terminator -e "filebot -get-subtitles --lang fr -rename -non-strict %f" -p ttt
Icon=gnome-subtitles
Name=Français (filebot)

[Desktop Action ro]
Exec=terminator -e "filebot -get-subtitles --lang ro -rename -non-strict %f" -p ttt
Icon=gnome-subtitles
Name=Româneşte (filebot)

[Desktop Action it]
Exec=terminator -e "filebot -get-subtitles --lang it -rename -non-strict %f" -p ttt
Icon=gnome-subtitles
Name=Italiano (filebot)

enter image description here

After that I have created a second such file which is almost identical, only it uses the subliminal tool. Also, the two files have different names in Name= under [Desktop Entry]: one is Name=Download subtitles (filebot), the other Name=Download subtitles (subliminal).

Nevertheless, all the eight actions of these two files appear grouped together under 'Subtitles'.

enter image description here

I was expecting that the names in Name=Download subtitles (filebot) and Name=Download subtitles (subliminal) to count for something, but they seem to do nothing.

I have created two desktop files with 4 actions each but it looks as if I had created a single desktop file with 8 actions, because the two files have in common the line X-KDE-Submenu=Subtitles.

I know I can separate the actions of the two files by setting different X-KDE-Submenu names, but then I will have two different toplevel entries (or two separate entries in Actions if I remove X-KDE-Priority=TopLevel).

But what I want is to have one toplevel entry called Subtitles with two sub-menus, one for filebot, the other for subliminal, and in each of these the four language options - similar to what I can add in a different OS in Nautilus. There, I have made this setting in Nautilus config tool:

enter image description here

Which gives this:

enter image description here

Is something similar possible in Dolphin?

1

After investigating a bit more I dare say the answer is probably NO.

The Nautilus sub-menus created through settings in nautilus action configuration tool are based on .desktop files created in /.local/share/file-manager/actions. But while the lowest levels (the actions themselves) are normal desktop actions, the intermediary sub-menus (that can go on numerous levels and can be multiplied many times through the nautilus action configuration tool) are not such normal desktop files, but contain Gconf settings.

A Nautilus normal action is a desktop file that contains the line Type=Action; the multipliable menus are desktop files that contain the line Type=Menu, but also a line like ItemsList=495e5ac1-e34b-4570-b7e2-fb2188410dff;034e7ec6-32f8-4538-956b-624e421593ac;c2ee726a-bda0-4e36-96db-e8cfaa7c83d6;f519ea3d-6937-457e-baf9-4a9dcd586062;, which is the Gconf setting.

I guess that is not doable in KDE and Dolphin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy