~grtcdr/darkman.el#1: 
darkman-mode fails to ping dbus service at times

hellow everybody the software is pretty amazing however i got the following error which will hang emacs but if i manually toggle darkman-mode two times it will always switch themes, my system dbus and emacs instance are both running fine according to your manual everythig is installed right, please help. have a great day everybody

darkman--dbus-service-unavailable-error: nl.whynothugo.darkman D-Bus service not available

Status
RESOLVED NOT_OUR_BUG
Submitter
Aleksas Tunikas
Assigned to
No-one
Submitted
1 year, 8 months ago
Updated
1 year, 6 months ago
Labels
bug

~grtcdr 1 year, 8 months ago

Hi,

darkman--dbus-service-unavailable-error: nl.whynothugo.darkman D-Bus service not available

Can you please ensure the Darkman daemon is working properly before Emacs is started?

Making requests to a D-Bus object will activate the corresponding D-Bus service if it wasn't already activated, this explains why things start working when you've manually toggled `darkman-mode' yourself.

If you're using systemd, run the following in your shell:

systemctl is-active --user darkman.service

The command will print "active" if the service is running without issues.

#Regards,

Aziz

Aleksas Tunikas 1 year, 8 months ago · edit

thank you your reply, it prints back active. also the automatic switch of everything but emacs (which is i think able to switch once but not back eg to black theme but not to white back i am pasting the debug log in case you might be interested)

Debugger entered--Lisp error: (error "nl.whynothugo.darkman D-Bus service not available") signal(error ("nl.whynothugo.darkman D-Bus service not available")) error("%s D-Bus service not available" "nl.whynothugo.darkman") darkman--dbus-service-unavailable-error() darkman--check-dbus-service() darkman-mode(1) custom-set-minor-mode(darkman-mode t) custom-theme-recalc-variable(darkman-mode) enable-theme(user) enable-theme(modus-operandi) load-theme(modus-operandi) darkman--load-theme(modus-operandi) darkman-set-theme() darkman-mode(1) custom-set-minor-mode(darkman-mode t) custom-theme-recalc-variable(darkman-mode) enable-theme(user) enable-theme(modus-operandi) load-theme(modus-operandi) darkman--load-theme(modus-operandi) darkman--signal-handler("light") apply(darkman--signal-handler "light") dbus-handle-event((dbus-event :session 4 2561 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))) funcall-interactively(dbus-handle-event (dbus-event :session 4 2561 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))) call-interactively(dbus-handle-event nil [(dbus-event :session 4 2561 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))]) command-execute(dbus-handle-event nil [(dbus-event :session 4 2561 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))] t) read-event(nil nil 0.0010500000000000002) dbus-call-method(:session "nl.whynothugo.darkman" "/org/freedesktop/DBus" "org.freedesktop.DBus.Peer" "Ping" :timeout 1000) dbus-ping(:session "nl.whynothugo.darkman" 1000) darkman--check-dbus-service() darkman-mode(1) custom-set-minor-mode(darkman-mode t) custom-theme-recalc-variable(darkman-mode) enable-theme(user) enable-theme(modus-operandi) load-theme(modus-operandi) darkman--load-theme(modus-operandi) darkman--signal-handler("light") apply(darkman--signal-handler "light") dbus-handle-event((dbus-event :session 4 2557 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))) funcall-interactively(dbus-handle-event (dbus-event :session 4 2557 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))) call-interactively(dbus-handle-event nil [(dbus-event :session 4 2557 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))]) command-execute(dbus-handle-event nil [(dbus-event :session 4 2557 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))] t) read-event(nil nil 0.001) dbus-call-method(:session "nl.whynothugo.darkman" "/nl/whynothugo/darkman" "org.freedesktop.DBus.Properties" "Set" :timeout 500 "nl.whynothugo.darkman" "Mode" (:variant "light")) dbus-set-property(:session "nl.whynothugo.darkman" "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "Mode" "light") darkman-set-mode(light) darkman-toggle() funcall-interactively(darkman-toggle) call-interactively(darkman-toggle record nil) command-execute(darkman-toggle record) execute-extended-command(nil "darkman-toggle") smex-read-and-run(("darkman-toggle" "read-only-mode" "darkman-mode" "darkman-set-theme" "eval-region" "revert-buffer" "bookmark-jump" "mu4e" "mu4e-headers-mark-pattern" "load-theme" "disable-theme" "sudo-edit" "customize-variable" "dired" "telega-buffer-file-send" "customize-group" "man" "package-install" "emms-volume-lower" "undo" "eshell-list-history" "telega-notifications-mode" "auto-revert-mode" "global-auto-revert-mode" "chatgpt-shell" "rename-buffer" "erc" "emms-browser" "list-processes" "visual-line-mode" "text-scale-decrease" "emms-insert-file" "telega-version" "telega-chatbuf-next-unread-mention" "eat-eshell-mode" "emms-browse-by-genre" "bookmark-set" "server-start" "telega-account-switch" "telega-msg-add-reaction" "emms" "speedbar" "eval-buffer" "xah-make-backup" "telega-view-search" "play-random-directory" "emms-insert-directory-tree" "visible-mode" "global-set-key" "package-delete" ...)) smex() funcall-interactively(smex) call-interactively(smex nil nil) command-execute(smex)

Aleksas Tunikas 1 year, 8 months ago · edit

http://ix.io/4GPl - properly formatted debug log

~grtcdr 1 year, 7 months ago

also the automatic switch of everything but emacs (which is i think able to switch once but not back eg to black theme but not to white back i am pasting the debug log in case you might be interested)

I'm not sure I understand the problem, could you please reformulate?

Debugger entered--Lisp error: (error "nl.whynothugo.darkman D-Bus service not available") signal(error ("nl.whynothugo.darkman D-Bus service not available")) error("%s D-Bus service not available" "nl.whynothugo.darkman") darkman--dbus-service-unavailable-error() darkman--check-dbus-service() darkman-mode(1) custom-set-minor-mode(darkman-mode t) custom-theme-recalc-variable(darkman-mode) enable-theme(user) enable-theme(modus-operandi) load-theme(modus-operandi) darkman--load-theme(modus-operandi) darkman-set-theme() darkman-mode(1) custom-set-minor-mode(darkman-mode t) custom-theme-recalc-variable(darkman-mode) enable-theme(user) enable-theme(modus-operandi)

I've flipped the stack trace for a more natural analysis, let's see what's going on.

So, you've run `darkman-toggle' interactively,

execute-extended-command(nil "darkman-toggle")

which internally invokes darkman-current-mode' whose result will be reversed and passed as a parameter to darkman-set-mode'.

This is confirmed by this next function call in the stack trace,

darkman-set-mode(light)

which tells us that the D-Bus daemon replied with "dark" and thus `darkman-set-mode' is instructed to set the mode to its opposite, i.e. "light".

This is good news, we are able to communicate with the D-Bus daemon, but something else is going wrong later on in the stack trace.

The last function call should have triggered a "ModeChanged" event, which we can confirm from

command-execute(dbus-handle-event nil [(dbus-event :session 4 2557 ":1.23" nil "/nl/whynothugo/darkman" "nl.whynothugo.darkman" "ModeChanged" darkman--signal-handler (:string "light"))] t)

which would execute a callback function

apply(darkman--signal-handler "light")

loading the corresponding theme

load-theme(modus-operandi)

What I understand from this is that darkman-toggle' works correctly. What doesn't work is darkman-mode' whose first invocation works as expected, but fails on the second due to what I presume is a timeout in the ping operation between the two applications (Emacs and Darkman).

I don't know what could be causing this ping timeout or why the behavior of `darkman-mode' is unpredictable.

I also can't reproduce this problem on my machine, so I'll keep the issue open in the hopes that someone more knowledgeable than me could help us figure it out.

Aleksas Tunikas 1 year, 6 months ago · edit

magically the issue resolved itself due time

~grtcdr 1 year, 6 months ago

magically the issue resolved itself due time

Good to know, I'll close the issue then.

~grtcdr REPORTED NOT_OUR_BUG 1 year, 6 months ago

Register here or Log in to comment, or comment via email.