Re: [Sawfish] Paste selection to window from lisp |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/sawfish Archives
]
- To: Brett Viren <brett.viren@xxxxxxxxx>
- Subject: Re: [Sawfish] Paste selection to window from lisp
- From: Mario Domenech Goulart <mario.goulart@xxxxxxxxx>
- Date: Tue, 02 Sep 2014 12:57:06 +0000
- Cc: sawfish@xxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=7dS1TswzKHwxJk9cza2jhE7hhJVm5uhnOO5aOgRK2Pw=; b=vzPbL+vBLFveM+7bqABmQN6kE1UVzGQou20ltlnHNzX2mkVong5SdSYrSw3TyMvCyM KPUcr5M7dC+1GSUi8liOSoiWJ1kjzt5MT711cP178o/rpaXB0IUnuACBsNQxKJJjZlxl X61kjQGR+WIb9ipFv6wfWDO+wZbFVqv+DerSouy5jHvLJBOIprcG6oiPJzR8Jat7F6U9 g7HH5lelIKVyTMLMKzOftrB6AMC9L6WrNoi7/Xe0jg4NKNchAWXxb7yTf2ywYv9ByhfH +AiktlJpEUDYxOOATbdPS2EhIQCG0/5MDbvlahQmcyZ34Ow0sDyh8DnNAdz4zQt5vuYk aLrQ==
Hi Brett,
On Sun, 31 Aug 2014 15:31:50 -0400 Brett Viren <brett.viren@xxxxxxxxx> 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)
I use something similar in
http://parenteses.org/mario/utils/sawfish-extra-menus#selection-menu
Best wishes.
Mario
--
http://parenteses.org/mario
--
Sawfish ML