This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Klipper: how to control which item selected?

Tags: None
(comma "," separated)
kwtm
Registered Member
Posts
1
Karma
0
OS
I would like to know how to use DBus to control which Klipper item is selected.

As you know, when I click on the Klipper icon in the system tray, it displays a history of the last few (10, in my case) items I copied to the clipboard. If, say, I highlight "abc" then Ctrl-C (say, in Kate) and then highlight "def" then Ctrl-C, then the first item in the history listed is "def" and the second item is "abc". Sometimes there is a checkmark next to one of the items.

If I then paste (say, with Ctrl-V), the item that is pasted is the one that shows the checkmark. However, sometimes there is no checkmark, and this causes a problem.

In my particular case, I am using a hotkey to run a script to put certain string (a customized non-standard timestamp) into Klipper with DBus. If you want to know the exact command, it is:
Code: Select all
qdbus org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents "$CLIPTEXT" 2>/dev/null

When I do this, pasting (with Ctrl-V or clicking on the paste icon or whatever) fails to paste the correct string, and instead pastes an earlier item. When I click on the system tray Klipper icon to show the history, it shows the correct history with the customized timestamp at the top, but there is no checkmark. Once I click on the item to put a checkmark there, the pasting works correctly.

My question is: is there a way to put a checkmark there with DBus so I can automate this from a script? Is there something like "setCheckmarkPositionInKlipperHistory" or some sort of DBus function I can call?

If there is not, would the KDE developers agree that this would be a useful function? (Presumably this function already exists internally but if it's not accessible by DBus, you could make it accessible?)

Thanks for any help you can give.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]