You are not logged in.

#1 2012-02-29 01:32:36

bjackman
Member
Registered: 2011-12-27
Posts: 32

Custom File Actions in Dolphin

I recently installed KDE 4.8. I'm surprised to find I really like it despite until now being an old skool kind of guy (I've finally got Linux on some decent hardware so I decided to start getting graphical up in this biatch)!

I'm trying to set up Dolphin/Konqueror to provide my own actions in file right-click menus, e.g. run a script with the selected file as an argument. I can't find any way to do it, or anything on the web. Am I being stupid or is this feature really missing? That would strike me as a pretty glaring hole! Maybe my expectations of Linux file browsers as beautiful catch-all bringers of convenience were too high.. (although as an aside, the almost-transparrent SFTP access is the Dog's Knees!)

Offline

#2 2012-03-01 18:24:24

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: Custom File Actions in Dolphin

You need to create the folder ~/.kde4/share/kde4/services/ServiceMenus and add .desktop files to it for every action you want to define. See /usr/share/kde4/services/ServiceMenus/ for some examples.

Here is another example I use for mounting cd images in cdemu

[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin,application/x-cd-image
Actions=loadInCdemu;
X-KDE-AuthorizeAction=shell_access

[Desktop Action loadInCdemu]
Exec=cdemu load any %u
Icon=k3b
Name=Load in CDEmu

PS: See http://techbase.kde.org/Development/Tut … vice_Menus
And for %value meanings: http://standards.freedesktop.org/deskto … 01s06.html

Last edited by teekay (2012-03-01 18:28:50)

Offline

#3 2012-03-01 21:48:54

bjackman
Member
Registered: 2011-12-27
Posts: 32

Re: Custom File Actions in Dolphin

Ah, thanks, that's more or less what I was looking for. Dolphin could do with some sort of "Create Custom Service Menu Item" option, with a little dialog to do this automatically. I suppose the correct way to say that is "I should implement a custom servicemenu dialog for KDE"!

Offline

#4 2012-03-02 08:20:06

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: Custom File Actions in Dolphin

Some KDE developer wrote a servicemenu editor already (never tried it though): http://www.sharpley.org.uk/node/3

AUR package: https://aur.archlinux.org/packages.php?ID=47750

Last edited by teekay (2012-03-02 08:24:09)

Offline

#5 2012-03-05 22:20:27

bjackman
Member
Registered: 2011-12-27
Posts: 32

Re: Custom File Actions in Dolphin

teekay wrote:

Some KDE developer wrote a servicemenu editor already (never tried it though): http://www.sharpley.org.uk/node/3

AUR package: https://aur.archlinux.org/packages.php?ID=47750

I've just re-installed this. The first time I did it it didn't work (I can't remember what the problem was, annoyingly, but it was evident to me that it was a pretty big oops). This time it seems to be working, and does the job. Probably I tried to install straight from the guy's site instead of using the PKGBUILD the first time. Anyway, I really don't  understand why something like this isn't included as part of KDE or at least Dolphin..

I'm not afraid of using Vim as my primary configuration tool but now I'm using a 2GB beast of a desktop environment that's inextricably linked to a GUI toolkit I come to expect easy-mode tools like this! Oh well!

Offline

Board footer

Powered by FluxBB