Create a entry in the Konqueror right click menu
I just couldn’t believe this was easy as following this recipe: Konqueror Services Menus
I wanted to be able to edit any file without having an editor associated to that all kind of files. So here’s the result:
File: editallfiles.desktop
[Desktop Entry]
ServiceTypes=all/allfiles
Actions=editAllFiles
Encoding=UTF-8
X-KDE-Priority=TopLevel
[Desktop Action editAllFiles]
Name=Edit with emacs
Icon=emacs
Exec=emacs %u

I’ve placed this file inside ~/.kde/share/apps/konqueror/servicesmenus/
and konqueror immediately used it. Now every time i right click on a file there is a entry called “Edit with emacs” after the emacs icon.
Now i can open any file even if there isn’t a application associated to it or if it already has one, the file is run by that application.
Note: the X-KDE-Priority=TopLevel is to put the entry right on the first menu, otherwise it appears as subsection of the main entry “Actions”.
I just can’t believe how easy this is and how i’ve been delaying this for ages! Isn’t KDE great?

Exactly what i searched for, though I use Kwrite, thanks. “I just can’t believe how easy this is and how i’ve been delaying this for ages!” <- exactly what I think about it, can’t remember how often I entered kwrite in the openwith dialog.
beer
August 26, 2008
glad you found it useful
Pedro Carvalho
August 26, 2008