|Re: [Sawfish] Paste selection to window from lisp|
[ Thread Index |
| More lists.tuxfamily.org/sawfish Archives
Not in front of a Linux machine, but xdotool has an argument that tlet's
you set the delay between keystrokes, maybe that does help.
On Sun, Aug 31, 2014 at 03:31:50PM -0400, Brett Viren wrote:
> I wrote a little function that lets me paste the contents of the X11
> selection to the currently focused window. I have it working using
> the "xdotool" program to perform the paste. The xdotool "types" the
> selection kind of slowly and I'd rather not rely on an external
> program. Is there a rep/sawfish function I can use to perform the
> paste. My searches for one came up empty. Or, is there maybe a
> better way to do this?
> Here is the function.
> (provide 'bv-paste)
> (defun xpasteto (w)
> "Paste current selection into current window"
> (interactive "%f")
> (require 'selection)
> (let ((selection (x-get-selection 'PRIMARY)))
> (let ((cmd (format nil "xdotool type --window %d \"%s\""
> (window-id w) selection)))
> (system cmd))))
> (bind-keys global-keymap "C-M-SPC" xpasteto)
> Sawfish ML