all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: joakim@verona.se
Cc: "andres.ramirez" <andres.ramirez@kipuamutay.com>, emacs-devel@gnu.org
Subject: Re: Issue connecting Emacs --daemon to D-BUS
Date: Mon, 08 Oct 2012 14:28:58 +0200	[thread overview]
Message-ID: <87zk3xkv05.fsf@gmx.de> (raw)
In-Reply-To: <87ipat1lj6.wl%andres.ramirez@kipuamutay.com> (andres ramirez's message of "Tue, 02 Oct 2012 00:38:05 -0500")

[Sorry for the late answer, I was offline last weeks due to vacation]

andres.ramirez <andres.ramirez@kipuamutay.com> 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.



      parent reply	other threads:[~2012-10-08 12:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27  9:42 Issue connecting Emacs --daemon to D-BUS joakim
2012-10-02  5:38 ` andres.ramirez
2012-10-03  1:31   ` Dan Nicolaescu
2012-10-08 12:28   ` Michael Albinus [this message]

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=87zk3xkv05.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=andres.ramirez@kipuamutay.com \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    /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/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.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.