|[Sawfish] Paste selection to window from lisp|
[ Thread Index |
| More lists.tuxfamily.org/sawfish Archives
- To: sawfish@xxxxxxxxxxxxxxxxxxx
- Subject: [Sawfish] Paste selection to window from lisp
- From: Brett Viren <brett.viren@xxxxxxxxx>
- Date: Sun, 31 Aug 2014 15:31:50 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=E5NjZZKgwLJoMZIl+r0Za8Pn3cyAlJOVEl1B+nAwUm0=; b=JCI+4PbowTyeycqjfqQAzKioMtk8WsGFS+UTW+JzC8C7tsjbPjd8IfJMNQiqUw0Wcj EPTUT8zs7R7vUiVXX2gDfrba+xmk88qI/VAyqhBO3uWnc8WVIAmCbx9cnBp8O+QS4jz3 GisE7rZcXRAWXrwtUqn241MmpmmZ4bfNrJlVSXcpFV981HcOLuX2/gaUr5NFH9VhT8e4 UQgU4Tk6AUChtefeFsX8x2pb4N9VSYseoe33GpxVkxQAETO9FrDssZCue/upA06p0kpi CqRkcmHOQ90a8GxkixMqjvuUZk/xL5k/fpduCjMv+CcZRxM0kjvvuqXKb/CCrAuPzfFP 9GHw==
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.
(defun xpasteto (w)
"Paste current selection into current window"
(let ((selection (x-get-selection 'PRIMARY)))
(let ((cmd (format nil "xdotool type --window %d \"%s\""
(window-id w) selection)))
(bind-keys global-keymap "C-M-SPC" xpasteto)