Pentadactyl/Vimperator: howto copy image to clipboard

2

My question is about the Firefox add-on Pentadactyl (the question is also relevant to it's parent project Vimperator). In Pentadactyl, there is a way to save an image:

;s

At this point, you select the image you wish to save, but I want to copy the image to clipboard.

Does anyone know if there is a simple way to do that?

Adobe

Posted 2011-07-09T16:19:28.793

Reputation: 1 883

Answers

0

Here's the best solution I could develop (valid for Linux only):

Install AutoKey, add a script there:

from Xlib import display

c = display.Display().screen().root.query_pointer()._data
x = c["root_x"]
y = c["root_y"]

mouse.click_absolute(x,y,3)
keyboard.send_key("<down>", repeat=10)

keyboard.press_key("<enter>")
keyboard.release_key("<enter>")

This script makes AutoKey press mouse-3, and then it presses ArrowDown 10 times (I have a 'Copy Image' there), and finally it presses Enter -- so that pic under Your current mouse position goes to clipboard. You can then bind this script to a key in AutoKey. Works more-or-less stable (don't call it several times at ones).

Adobe

Posted 2011-07-09T16:19:28.793

Reputation: 1 883

All of that with xdotool: xdotool click 3 key Down Down Down Down Down Down Down Return. – manveru – 2012-10-29T11:00:21.107

@manveru: both these solutions are bad. They use GUI, and the number of menu entries depends on the extensions installed. – Adobe – 2012-10-29T12:08:28.943

0

Not sure if this was available when the question was asked, but pentadactyl has a yank hint mode now, accessed through ;y, after which you select the link or image you want to yank, just like for ;s

See :help hints for all the available hints modes

martijn

Posted 2011-07-09T16:19:28.793

Reputation: 1