More Fun with KDE Service Menus

Dmitri Popov

Productivity Sauce

Jan 17, 2014 GMT
Dmitri Popov

Using the service menus feature in KDE, you can add all kinds of useful commands to the Actions entry of the context menu. The previous post demonstrated how you can add Déjà Dup-related commands to restore missing files and revert a file to a previous version. Of course, you can put the service menus feature to other clever uses, too. For example, I usually resize photos before publishing them on the web using the convert tool in ImageMagick. But instead of switching to terminal and running the convert foo.jpg -resize 1600x1600> foo.jpg command manually every time I need to shrink a photo, I created a service menu that allows me to quickly resize images from the convenience of the Dolphin file manager. I created the ~/.kde4/share/kde4/services/ServiceMenus/resize-large.desktop file and added the service menu definition below:

[Desktop Entry]
[Desktop Action ResizeLarge]
Name= Resize 1600x1600>
Exec=convert %f -resize "1600x1600>" %f

To limit the menu to specific image formats, I specified them in the MimeType part. I also assigned an icon to the menu entry using the Icon variable.

If you are interested in learning more about how to create service menus, the Creating Konqueror Service Menus article on KDE TechBase and the Create Your Own Custom KDE Service Menu tutorial offers a lot of useful info on the subject.

comments powered by Disqus