[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fw: [Xbindkeys-devel] reading the output of run-command
From: |
Philippe Brochard |
Subject: |
Fw: [Xbindkeys-devel] reading the output of run-command |
Date: |
Tue, 09 Jun 2009 21:11:07 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
From: Marc Belmont <...>
Subject: Re: [Xbindkeys-devel] reading the output of run-command
To: Philippe Brochard <...>
Date: Tue, 9 Jun 2009 17:00:32 +0200
On Mon, Jun 8, 2009 at 9:44 PM, Philippe Brochard <...> wrote:
Marc Belmont writes:
> hi,
>
Hi,
> I wanted to read the output of run-command and I wrote this scheme
code
> (define (shell-run cmd)
> (let* ((port (open-input-pipe cmd))
> (str (read-line port)))
> (close-port port)
> str))
>
I see nothing wrong with your code (expect maybe the indentation). And
it's in the guile manual.
> and then something like
> (xbindkey-function '(a) (lambda () (display (shell-run "xdotool
getmouselocation"))))
> it's working ok 5 times and then I get an error
> glibc detected *** xbindkeys: free(): invalid next size (fast):
0x80512a0 ***...
> What's wrong with my code?
>
Please, can you try this code directly with guile:
--------------------------------------------------
(use-modules (ice-9 popen))
(use-modules (ice-9 rdelim))
(define (shell-run cmd)
(let* ((port (open-input-pipe cmd))
(str (read-line port)))
(close-port port)
str))
(do ((i 0 (1+ i)))
((= i 1000))
(display (shell-run "echo foo bar")))
--------------------------------------------------
works ok
Then with xbindkeys in the xbindkeysrc.scm but with no keys associated.
And then with a key associated. Something like this:
--------------------------------------------------
(xbindkey-function '(a) (lambda ()
(do ((i 0 (1+ i)))
((= i 1000))
(display (shell-run "echo foo bar")))))
--------------------------------------------------
prints 5 times foo bar and then I get the error: glibc detected ***
xbindkeys: free(): invalid next size (fast)
I use ubuntu linux inside of vmware. Host OS is Vista.
regards, marc
I'd like to see if the problem is in xbindkeys itself or if it comes
from guile.
Thanks for your feedback,
Philippe