-*- mode: org -*-
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. That’s basically it.
Normally, guile-daemon
will not exit: it’s a daemon, so it just “sits”
on a FIFO file waiting for commands.
Along with guile-daemon
program, Guile-Daemon provides gdpipe
shell
script that redirects commands to the default FIFO file.
Finally, you can also connect to the daemon using a socket file (for
example, with M-x geiser-connect-local
if you use Geiser).
By default, socket and FIFO files are placed in $XDG_CONFIG_HOME/guile-daemon/run directory ($HOME/.config/guile-daemon/run if XDG_CONFIG_HOME is not set).
Simply run guile-daemon
(remember, it won’t fork!), and then use
gdpipe
to evaluate anything, like this:
gdpipe '(format #t "load path: ~a~%" %load-path)'
(on a console where guile-daemon
is running you should see the load
path)
I use Guile-Daemon as an OSD daemon, see my config.
Requirements for building from git:
Run ./autogen.sh
to generate the build system infrastructure. After
that, the program can be built and installed with the usual sequence of
commands of the GNU Build System:
$ ./configure
$ make
# make install
It is possible to use/test Guile-Daemon without installing (i.e., after
running make
but before running make install
) with the help of
pre-inst-env
script in the top build tree, like this:
$ ./pre-inst-env guile-daemon &
$ ./pre-inst-env gdpipe ...
If you live in Emacs, you may find pre-inst-env.el
more useful. If
you load this file (for example, with M-x load-file
), it will set the
required environment inside Emacs, so you can run guile-daemon
and
gdpipe
in M-x shell
without prefixing them with .../pre-inst-env
.
And more importantly, you can start Geiser and use (daemon …) modules
there!
The latest version of Guile-Daemon can be installed with GNU Guix: https://www.gnu.org/software/guix/packages/g.html#guile-daemon.
Also this repository contains guix.scm file which can be used to build/install Guile-Daemon using the git checkout, or to make a development environment for it (see the commentary in that file for more details).