KDE plasma / Dolphin equivalent of a Nautilus script

Hey there!

I am so close to moving to Endeavour OS from my Ubuntu 22.04 install on my laptop. And thank you again to everyone who has helped me and answered my silly questions. I am trying to just double-check a few last things so that I do not lose too much productivity time after I make the switch.

Currently in my Ubuntu install I have 3 bash scripts I created that I use for quickly converting some file types that I use in my work on a regular basis. They are in my home folder under /home/ME/.local/share/nautilus/scripts

When I right click on a file, I have a menu item called Scripts and that expands to show my three bash scripts so I can run one against a given file. Is there something like this in KDE Plasma (or in Dolphin)? I love that I can create these scripts and drop them in the folder and they automatically show up in the right click menu. I tried Googling this and could not seem to find a clear (or understandable for me) answer.

If I can figure this out I will only have one or two things left to figure out and can then make the switch to Endeavour OS. I cannot remember what one of those things was, but I am hoping I will in the next few hours, lol. Not enough coffee yet today, but really is there any amount of coffee that is truly enough? I am so excited to be this close to making the switch and am hoping I can maybe do it Sunday evening or Monday morning. Thank you again for all of your help and putting up with my questions. This community is awesome and I am looking forward to becoming part of it. Hopefully one day I will know enough to be able to help others the way you have all helped me.


You add service menu entries to .local/share/kservices5/ServiceMenus

The desktop files look like this:

[Desktop Entry]

[Desktop Action messageFun]
Name=Pointless message
Exec=kdialog --msgbox "This is pointless"

It will show up in the actions part of the context menu in dolphin.


Take a look at this link:


Okay, that helps a lot. So can I have the .desktop execute the bash script, or do I move the bash script into the .desktop file? For instance, this is one of the bash scripts I use:

for fullpath in "$@"
    filename="${fullpath##*/}"                      # Strip longest match of */ from start
    dir="${fullpath:0:${#fullpath} - ${#filename}}" # Substring from 0 thru pos of filename
    base="${filename%.[^.]*}"                       # Strip shortest match of . plus at least one non-dot char from end
    ext="${filename:${#base} + 1}"                  # Substring from len of base thru end
    if [[ -z "$base" && -n "$ext" ]]; then          # If we have an extension and no base, it's really the base
    printf 'Creating directory\n' >> log
    mkdir $base || exit
    printf 'Converting PDF to PNGs\n' >> log
    printf "$filename /$base/$base\n" >> log
    pdftoppm -png "$filename" "./$base/$base"
    printf 'All done\n\n' >> log

I can confirm what dalto said.

I made my own


I copied from p7zip-gui . You can check the components after installation with “pacman -Qil p7zip-gui”.

[Desktop Entry]
X-KDE-Submenu=7-Zip (wine)


[Desktop Action CompressDialog]
Name=Add to Archive ...
Exec=wine "C:\\Program Files\\7-Zip\\7zG.exe" -ad a %n.7z %n

[Desktop Action test]
Name=Test Archive
Exec=wine "C:\\Program Files\\7-Zip\\7zG.exe" -ad t %U

[Desktop Action hash]
Name=Hash (all)
Exec=wine "C:\\Program Files\\7-Zip\\7zG.exe" -ad h -scrc* %U

[Desktop Action Compress7z]
Name=Add to 7z Archive
Exec=wine "C:\\Program Files\\7-Zip\\7zG.exe" a -t7z %n.7z %n

[Desktop Action CompressZip]
Name=Add to Zip Archive
Exec=wine "C:\\Program Files\\7-Zip\\7zG.exe" a -tzip %n.zip %n

[Desktop Action ExtractTo]
Name=Extract to ...
Exec=wine "C:\\Program Files\\7-Zip\\7zG.exe" -ad x %U

Update1 :

1 Like

Definitely have the desktop execute the script file.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.