Dolphin: Copy file path to klipper

Monday, February 20. 2012

On windows I used to like the Windows Explorer as a file manager, at least in the shape it had with w2k. And there has been  toy pack by Microsoft which, among other more or less useful add ons, allowed me to add an "send to clipboard" entry to the context menue of any file which would push the file's path into the clipboard and thus helped me to avoid typing it. I missed it ever since I changed to linux/KDE as my desktop environment. Yes, you can get the folder path but that's not all I wanted.

However I found hob to fix this and add such an entry to the dolphin file manaer's context menue, and it was easy, too.

The thing that needs to be added is called a ServiceMenu in KDE jargon, I let locate find me where those sort of files live on my system and it returned a number of them at /usr/share/kde4/services/ServiceMenus/. I assume there are other folders you could put them , i.e. below ~/.kde/, but I was in a hurry and just got root to create /usr/share/kde4/services/ServiceMenus/sendPathToClipboard.desktop The name is not important as long as it is unique and ends in .desktop.

Opened it in an editor and this is what I put there:

[Desktop Entry]

Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/octet-stream
Actions=sendToClipboard
 
[Desktop Action sendToClipboard]
Name=send Path to Clipboard
Exec=qdbus org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents %u
Icon=klipper
 
Save it, open dolphin, right click on some file and in the Actions submenu appears a new entry. With a fancy klipper icon athe the start of the line - I just guessed that part of the .desktop file and it worked immediately.
Some infos to this are here (though related to KDE3 so it didnt work  as dcop isn't used in KDE4 and here (dcop has been replaced by qdbus with KDE4)

 

 



Trackbacks


Trackback specific URI for this entry
    No Trackbacks

Comments


    No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA