Customising KDE - Service Menus
Well, it’s been probably over a month since I’ve had to boot back to Windows for anything of susbstance. I’m now hapilly running Kubuntu (Ubuntu with KDE) and all is good. My current mind bend involves getting myself set up for video editing which includes being able to convert from this codec to that codec, and understand about a billion commandline options.
This post is for one reason really - to make sure that I don’t lose these two handy URL’s. The first details how to make your own custom actions for files (the items that appear under “Actions” when you right click a file) [http://www.tuxmagazine.com/node/1000172] and the second is a quick HOWTO for how to add “Send via email” to the Actions menu [http://www.kde-forum.org/artikel/14019/How-To-add-Send-Email-to-right-click-Actions-menu.html].
Here’s another useful link: http://developer.kde.org/documentation/tutorials/dot/servicemenus.html
I’ve just thrown this together to give me some actions to resize image files before I upload them. I’m not sure if it supports multiple files at once, but it looks like there’s support for this via the %F variable (read the pages for examples, or check back later).
[Desktop Entry]X-KDE-Submenu=Resize For WebServiceTypes=image/*Actions=ResizeForWeb1024;ResizeForWeb800;ResizeForWeb640 [Desktop Action ResizeForWeb1024]Name=1024x768Exec=convert %f -resize 1024x768 %f [Desktop Action ResizeForWeb800]Name=800x600Exec=convert %f -resize 800x600 %f [Desktop Action ResizeForWeb640]Name=640x480Exec=convert %f -resize 640x480 %f
(save this in /home/bob/.kde/share/apps/konqueror/servicemenus/resize-for-web.desktop)
Now, when you right click on an image file (any file that matches the mimetype image/*) in Konqueror and choose Actions, you’ll see a “Resize for Web” menu with 1024×768, 800×600 and 640×480 in it. Be warned, it will overwrite your original file.
By the way, you need to have ImageMagick installed (as the ‘convert’ tool that I am using it part of that package).
That’s all for now!