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)

 

 

The trash has reached its maximum size!

Wednesday, February 9. 2011

Nein, ich meine nicht RTL2 auf einem Breitwand-Fernseher...
Ich pendele ohnehin, was file managment angeht, auf dem Linux desktop (Debian Squeeze, KDE) zwischen grafischer Oberfläche und Terminal / mc hin- und her, aber seit einer Weile wollte Dolphin mich nun gar keine Dateien mehr löschen lassen. Stattdessen bekam ich einen Dolphin error gezeigt:
"The trash has reached its maximum size! Cleanup the trash manually. "

Dabei war der Trash in  ~/.local/share/Trash bis auf drei folder und eine Datei metadata ganz leer. Aber metadata hatte einen konfusen Eintrag, 

[Cached]
Size=18446744073517368387

Der Wert scheint nicht willkürlich zu sein,  Google findet mehrere Seiten von KDE-Nutzern, die diese Zahl bei sich vorfanden. Die Abhilfe war zum Glück einfach: metadata (von der command line) löschen und nach dem nächsten "Move to trash" hat sich dolphin korrekte Metadaten neu erzeugt.

(Page 1 of 1, totaling 2 entries)