Saturday, May 4, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1622  / 2 Years ago, fri, november 26, 2021, 5:55:43

Is there a command for pasting what is in clipboard?

I need a command that does the same thing as to press Ctrl+V.



I tried a few options for xclip, but they don't paste normally and need middle click or so.


More From » command-line

 Answers
2

Klipper



The Kubuntu is using as default the Klipper. KDE UserBase: http://userbase.kde.org/Klipper



As a KDE/Qt application the Klipper can be used via the qdbus: http://manpages.ubuntu.com/manpages/trusty/man1/qdbus.1.html



Available commands can be viewed with the qdbusviewer:



enter image description here



or with the terminal (konsole):



:~$ qdbus org.kde.klipper /klipper
method void org.kde.klipper.klipper.clearClipboardContents()
method void org.kde.klipper.klipper.clearClipboardHistory()
method QString org.kde.klipper.klipper.getClipboardContents()
method QString org.kde.klipper.klipper.getClipboardHistoryItem(int i)
method QStringList org.kde.klipper.klipper.getClipboardHistoryMenu()
method void org.kde.klipper.klipper.saveClipboardHistory()
method void org.kde.klipper.klipper.setClipboardContents(QString s)
method void org.kde.klipper.klipper.showKlipperManuallyInvokeActionMenu()
method void org.kde.klipper.klipper.showKlipperPopupMenu()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface_name, QString property_name)
method QVariantMap org.freedesktop.DBus.Properties.GetAll(QString interface_name)
method void org.freedesktop.DBus.Properties.Set(QString interface_name, QString property_name, QDBusVariant value)
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QString org.freedesktop.DBus.Peer.GetMachineId()
method void org.freedesktop.DBus.Peer.Ping()


The command



qdbus org.kde.klipper /klipper getClipboardContents


will get the last line from the clipboard.



The command can added to the KDE menu (http://docs.kde.org/development/en/kde-workspace/kmenuedit/index.html) and called with the keyboard shortcut or to the file manager context menu (KDE service menu - http://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus).



enter image description here



Other options for the clipboard managers: http://qt-apps.org/content/show.php/CopyQ?content=147452


[#27887] Saturday, November 27, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
assionortly

Total Points: 423
Total Questions: 121
Total Answers: 115

Location: Chad
Member since Wed, Sep 30, 2020
4 Years ago
;