diff mbox

[3/3] gnu: Add guile-daemon.

Message ID 20160722082125.3677-4-alezost@gmail.com
State New
Headers show

Commit Message

Alex Kost July 22, 2016, 8:21 a.m. UTC
* gnu/packages/guile.scm (guile-daemon): New variable.
---
 gnu/packages/guile.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Ludovic Courtès July 23, 2016, 11:07 a.m. UTC | #1
Alex Kost <alezost@gmail.com> skribis:

> * gnu/packages/guile.scm (guile-daemon): New variable.

OK!

> +    (home-page "https://github.com/alezost/guile-daemon")
> +    (synopsis "Evaluate code in a running Guile process")
> +    (description
> +     "Guile-Daemon is a small Guile program that loads your initial
> +configuration file, and then reads and evaluates Guile expressions that
> +you send to a FIFO file.")

This looks a lot like ‘guile --listen’, except without the REPL prompt
and stuff, right?

Thanks,
Ludo’.
Alex Kost July 24, 2016, 6:13 a.m. UTC | #2
Ludovic Courtès (2016-07-23 14:07 +0300) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> * gnu/packages/guile.scm (guile-daemon): New variable.
>
> OK!
>
>> +    (home-page "https://github.com/alezost/guile-daemon")
>> +    (synopsis "Evaluate code in a running Guile process")
>> +    (description
>> +     "Guile-Daemon is a small Guile program that loads your initial
>> +configuration file, and then reads and evaluates Guile expressions that
>> +you send to a FIFO file.")
>
> This looks a lot like ‘guile --listen’, except without the REPL prompt
> and stuff, right?

Sorry, I don't understand what «without the REPL prompt and stuff» means :-)

I wrote Guile-Daemon because I needed a general-purpose guile process
running all the time to which I can send expressions for evaluating.

So I run 'guile-daemon', and then I can do something like this:

  echo '(something #:useful? #t)' > /path/to/daemon-fifo-file

Actually there is 'gdpipe' shell script that does this redirection:

  gdpipe '(something #:useful? #t)'

As for 'guile --listen', yes, Guile-Daemon also starts a socket to which
you can connect with "M-x geiser-connect-local" or alike.

If anyone is interested, I use it as an OSD daemon, particularly to set
sound volume/muteness and to display it using Guile-XOSD.  Here is a
small demo:

https://raw.github.com/alezost/guile-daemon-config/master/sound-volume-demo.gif

My Guile-Daemon config:
<https://github.com/alezost/guile-daemon-config>.
Ludovic Courtès July 24, 2016, 10:53 p.m. UTC | #3
Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2016-07-23 14:07 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> skribis:
>>
>>> * gnu/packages/guile.scm (guile-daemon): New variable.
>>
>> OK!
>>
>>> +    (home-page "https://github.com/alezost/guile-daemon")
>>> +    (synopsis "Evaluate code in a running Guile process")
>>> +    (description
>>> +     "Guile-Daemon is a small Guile program that loads your initial
>>> +configuration file, and then reads and evaluates Guile expressions that
>>> +you send to a FIFO file.")
>>
>> This looks a lot like ‘guile --listen’, except without the REPL prompt
>> and stuff, right?
>
> Sorry, I don't understand what «without the REPL prompt and stuff» means :-)

‘guile --listen’ gives you a REPL prompt, which is nice for interactive
stuff, but less nice for scripting.

> I wrote Guile-Daemon because I needed a general-purpose guile process
> running all the time to which I can send expressions for evaluating.
>
> So I run 'guile-daemon', and then I can do something like this:
>
>   echo '(something #:useful? #t)' > /path/to/daemon-fifo-file
>
> Actually there is 'gdpipe' shell script that does this redirection:
>
>   gdpipe '(something #:useful? #t)'
>
> As for 'guile --listen', yes, Guile-Daemon also starts a socket to which
> you can connect with "M-x geiser-connect-local" or alike.

Understood, it does sound useful.

> If anyone is interested, I use it as an OSD daemon, particularly to set
> sound volume/muteness and to display it using Guile-XOSD.  Here is a
> small demo:
>
> https://raw.github.com/alezost/guile-daemon-config/master/sound-volume-demo.gif

Pretty neat!

Thanks,
Ludo’.
diff mbox

Patch

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 9b85016..acae23e 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -1154,4 +1154,29 @@  SQL databases.  This package implements the interface for SQLite.")
 library}.")
     (license gpl3+)))
 
+(define-public guile-daemon
+  (package
+    (name "guile-daemon")
+    (version "0.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/alezost/" name
+                                  "/releases/download/v" version
+                                  "/" name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1s90h8qhblhhz4ahn3p5d573a24px6cdjq2w311ibpgwnsni4qvq"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("guile" ,guile-2.0)))
+    (home-page "https://github.com/alezost/guile-daemon")
+    (synopsis "Evaluate code in a running Guile process")
+    (description
+     "Guile-Daemon is a small Guile program that loads your initial
+configuration file, and then reads and evaluates Guile expressions that
+you send to a FIFO file.")
+    (license gpl3+)))
+
 ;;; guile.scm ends here