Ubuntu – Clipboard manager with “history paste” support

12.10clipboardgnomeshortcut-keyssoftware-recommendation

I am looking for a clipboard manager, but I don't want one that just keeps a list so I can select an item to bring it to the front of the clipboard, nah, that's too easy.

What I am looking for is a clipboard manager where I can assign say
Ctrl+Shift+1 to paste the first item in the clipboard,
Ctrl+Shift+2 to paste the second item in the clipboard

Ctrl+Shift+9 to paste the ninth item in the clipboard
Ctrl+Shift+0 to paste the tenth item in the clipboard

why?
As we web developer I am often pasting alternating lines of code (remember, not all browsers support CSS3!),

<tr class="odd">...</tr>  
<tr class="even">...</tr>
<tr class="odd">...</tr>  
<tr class="even">...</tr>

So, the ability to just sit there doing
Ctrl+Shift+1 Enter

Ctrl+Shift+2 Enter

Would be a huge help,

I am using 12.10 with gnome-shell 3.6.2.

I have looked into gPaste and such, but none seem to have this feature.

Best Answer

I'm not aware of a clipboard manager that itself provides the feature you want, but there are two ways in which I imagine that Klipper could be incorporated in a solution.

  1. Klipper offers "Next History Item" and "Previous History Item" shortcuts that change the order of the clipboard history. Therefore, pasting the nth entry can be done by running the "Next History Item" shortcut n times, then running Ctrl+V (or whatever your paste shortcut is), and then -- to put the history back into its original order -- running the "Previous History Item" shortcut n times. Using this, your problem reduces to setting a shortcut that simulates entering a series of shortcuts.
  2. The command qdbus org.kde.klipper /klipper getClipboardHistoryItem n where the n at the end is a number (e.g. 0, 1, 2...) will output the nth clipboard history item. Using this, your problem reduces to the problem of setting a keyboard shortcut that will paste the output of a command.