Ubuntu – A command for pasting; the same as Ctrl + V

command linekubuntu

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.

Best Answer


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