[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue connecting Emacs --daemon to D-BUS
From: |
Michael Albinus |
Subject: |
Re: Issue connecting Emacs --daemon to D-BUS |
Date: |
Mon, 08 Oct 2012 14:28:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
[Sorry for the late answer, I was offline last weeks due to vacation]
andres.ramirez <address@hidden> writes:
Hi Joakim.
> From a Discussion with Michael Albinus.
>
> This is what works for me. Using the emacs trunk:
>
> - You start the daemon as usual via crontab:
>
> @reboot /usr/local/src/emacs/src/emacs --quick --eval \(progn\ \(setq\
> server-name\ \"test\"\)\ \) --daemon
>
> - In your emacsclient call, you hand over $DBUS_SESSION_BUS_ADDRESS via
> the variable `my-dbus-address':
>
> emacsclient -s test -c -e \(setq\ my-dbus-address\
> \"$DBUS_SESSION_BUS_ADDRESS\"\)
>
> Instead of expanding $DBUS_SESSION_BUS_ADDRESS you could use any
> address string, once you know it.
>
> - In your Emacs daemon, you can now apply the following code:
>
> (progn
> (require 'notifications)
> (dbus-init-bus my-dbus-address)
> (notifications-notify
> :bus my-dbus-address
> :title "nick"
> :body "message"
> :app-icon
> "/usr/share/notify-osd/icons/gnome/scalable/status/notification-message-im.svg"
> :urgency 'low))
Does this recipe work for you? It is a limited use case, because you
have to manage your own session bus address, instead of using `:session'.
If you need a more general solution, because you use libraries which
depend on the `:session' bus, you might try to postpone the load of dbus.el
to the emacsclient call, after setting $DBUS_SESSION_BUS_ADDRESS properly.
Best regards, Michael.