Is there an easy way of creating a "create archive" item to the context menu of dolphin (like the one, that can be added to thunar or nautilus)?
1 Answer
Go to
~/.kde/share/kde4/services/ServiceMenus
Add a new file:
createArchive.desktop
Paste the following content:
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
Actions=createAnArchive
MimeType=all/all
[Desktop Action createMyArchive]
Name=Create Archive...
Exec=file-roller --add %U
Restart Dolphin: close all instances (and eventually open again) You might now check, if you successfully added that entry:
Open dolphin -> Settings -> Configure Dolphin -> Services -> [check, If the list contains
"Create Archive...". Also make sure it's checked]
Now you should be able to see the following entry:
Dolphin -> Context Menu -> Actions -> Create Archive
explanation:
MimeType=all/all
"all/all" makes sure, that the item will appear for any selected file, you use
Actions=createAnArchive
The action specified here must be the same as in
[Desktop Action createMyArchive]
This is the action, that will be called
Exec=file-roller --add %U
File-roller is the archive-program %U will make invoke ONE instance of file-roller with ALL the selected files as parameters. If you use %F here, you will invoke ONE instance PER selected item - which is probably not, what you want.
You might also want to check out the dir
/usr/share/mime/
to see further mimetypes, in order you want to restrict it more
-
unfortunately, this doesnt seem to work in ubuntu. there is no
ServiceMenus
underservices
, and even with creating this folder, no luck. edit:/usr/share/kde4/services/ServiceMenus
seems to be the right folder.– phil294Apr 6, 2017 at 16:50