Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sauron and dbus #49

Open
MaksVal opened this issue May 31, 2016 · 6 comments
Open

sauron and dbus #49

MaksVal opened this issue May 31, 2016 · 6 comments

Comments

@MaksVal
Copy link

MaksVal commented May 31, 2016

Hi!
Thanks for your work!

I tried your module, with dbus. But I have a trouble with it.
Redefine modules:
(setq sauron-modules '(sauron-dbus sauron-org sauron-notifications))

And please, look at:
2016-05-31 09:09:02 sauron 3 sauron started: sauron-org, sauron-notifications

Where is dbus?
Sauron didn't listen dbus? I saw my message in dbus-monitor program...
Emacs 24.5.1, sauron: elpa/sauron-20160501.1045/
Thanks!

@djcb
Copy link
Owner

djcb commented Jun 5, 2016

Hmm, that should work; the module should show up there, even if it didn't work. Anything mentioned in your message buffer? And does it work after you restart emacs / sauron with this variable in your config?

@MaksVal
Copy link
Author

MaksVal commented Jul 25, 2016

I using emacs in daemon mode. I start the module with this command: sauron-start.

This is my config:

(require 'sauron)

(global-set-key (kbd "C-c s") 'sauron-toggle-hide-show)
(global-set-key (kbd "C-c t") 'sauron-clear)

(setq
 sauron-modules '(sauron-dbus sauron-org sauron-notifications))

(setq
  sauron-max-line-length 120

  sauron-separate-frame nil
  sauron-watch-patterns
  '("emacs-fu" "emacsfu" "wombat" "capybara" "yak" "gnu" "\\bmu\\b" "mail")

(add-hook 'sauron-event-added-functions
  (lambda (origin prio msg &optional props)
    (if (string-match "ping" msg)
      (sauron-fx-sox "/usr/share/sounds/ping.wav"))
    (cond
      ((= prio 3) (sauron-fx-sox "/usr/share/sounds/pop.wav"))
      ((= prio 4) (sauron-fx-sox "/usr/share/sounds/pop.wav"))
      ((= prio 5)
    (sauron-fx-sox "/usr/share/sounds/pop.wav")
    (sauron-fx-gnome-osd(format "%S: %s" origin msg) 5)))))

;; events to ignore
(add-hook 'sauron-event-block-functions
  (lambda (origin prio msg &optional props)
    (or
     (string-match "^*** Users" msg)))) ;; filter out IRC spam

(setq sauron-dbus-cookie t)

(provide 'config-sauron)

The Message buffer is clean. This is content in the buffer:
2016-07-25 09:16:44 sauron 3 sauron started: sauron-org, sauron-notifications

@djcb
Copy link
Owner

djcb commented Nov 5, 2017

Most likely you've started emacs (ie., the daemon) in an environment without a dbus session.
What does (getenv "DBUS_SESSION_BUS_ADDRESS") say?

@troublew
Copy link

Hie, I'm having trouble too using dbus.
I've rightfully started dbus, and launched emacs with "dbus-launch --exit-with-session emacs".
When I test (getenv "DBUS_SESSION_BUS_ADDRESS"), I get:
"unix:abstract=/tmp/dbus-HL8k3Ba2Qy,guid=0c6062be5651ffb8213076e85a9131de".
But I still can't use the exemples you provide.
When I try one, I get in dbus-monitor --session:

error time=1519465200.330796 sender=org.freedesktop.DBus -> destination=:1.22 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=2
   string "The name org.gnu.Emacs was not provided by any .service files"

When I try (dbus-list-names :session), I get:
("org.freedesktop.DBus" ":1.0" "org.gnu.Emacs")
When I try (dbus-list-activatable-names :session), I get:
("org.freedesktop.DBus" "org.gtk.GLib.PACRunner" "org.a11y.Bus")

I don't understand what is the problem. I'm running gentoo. Maybe is it a permission problem? I can't find what is the path where the services are registered in.

@djcb
Copy link
Owner

djcb commented Mar 10, 2018

Was your emacs built with DBus support?

@troublew
Copy link

troublew commented Jun 24, 2018

After all that time, I came back to check the problem again, and that was a problem of permission. I have "umask 022" and it broke a lot of packages, including dbus.
Sorry for the issue, I was in fault since the beginning.
Thanks a lot of the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants