From: "Ludovic Courtès" <ludo@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Proof of concept: Shepherd + DBus = ♥
Date: Sat, 25 Feb 2023 19:38:30 +0100 [thread overview]
Message-ID: <87h6v9vbdl.fsf@gnu.org> (raw)
In-Reply-To: <c36def4a1962ac74542209ed2aad84dcace49b06.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 24 Feb 2023 21:55:40 +0100")
Hello!
Liliana Marie Prikler <liliana.prikler@gmail.com> skribis:
> this comes a little late, as Gnome folks have decided that evaluating
> arbitrary Javascript over DBus is perhaps not always the wisest idea¹,
Too bad, what could possibly go wrong?
[...]
> Once you set the unsafe flag in Looking Glass and promise to be a very
> good girl, you can now extract environment variables.
>
> $ herd getenv gnome PATH
>
> ;;; (reply #t "\"/gnu/store/s43dhx83c3a2g79vs5anf3wdmv9lwpi3-glib-
> 2.70.2-bin/bin:/run/setuid-
> programs:/home/yuri/.config/guix/current/bin:$HOME/.guix-
> profile/bin:$HOME/.guix-profile/sbin:/run/current-
> system/profile/bin:/run/current-system/profile/sbin\"")
>
>
> If you were naughty and didn't do the magic dance, you get a rather
> unhelpful result instead.
>
> $ herd getenv gnome PATH
>
> ;;; (reply #f "")
This is super cool and super useful. Is there some way we could achieve
this (getenv/setenv in the GNOME Shell process) without resorting to JS?
(💡 Did you know? On GNU/Hurd, each process implements the “msg” RPC
interface, which, among other things, lets you inspect and change its
environment variables! If you have a childhurd running, try something
like: “msgport --getenv=PATH -p $$”.)
> Anyway, we can now talk to DBus services from Shepherd, although doing
> so is currently a bit of a pain in the buttocks. Much of this is due
> to guile-ac-d-bus being somewhat obtuse and not having enough fibers in
> it. That being said, I'm sure there's some other use-case out there
> that is a good fit for this (wanna talk to loginctl for hibernation
> perhaps?)
Yes! Provided suitable Fibers integration, we could have services that
automatically start/stop based on some notification received on the bus
(devices plugged/unplugged, power or network condition changes, etc.).
Pretty exciting.
Thanks for sharing!
Ludo’.
next prev parent reply other threads:[~2023-02-25 18:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 20:55 Proof of concept: Shepherd + DBus = ♥ Liliana Marie Prikler
2023-02-25 3:29 ` Maxim Cournoyer
2023-02-25 18:38 ` Ludovic Courtès [this message]
2023-02-25 19:34 ` Liliana Marie Prikler
2023-03-06 17:28 ` Ludovic Courtès
2023-04-11 13:44 ` Simon Tournier
2023-04-12 5:30 ` Liliana Marie Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6v9vbdl.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=liliana.prikler@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.