Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

5
Desktop notifications not working on KDE
Post Body

On Emacs 27.2 I am trying to get notifications to work on my KDE desktop. Please note that notifications work just fine on my XFCE desktop.

I can reproduce the issue easily:

ELISP> (notifications-notify)

Which produces the following error message:

Error: (dbus-error "No connection to bus" session)

I have tried to run dbus-launch before starting emacs but I get the same behavior.

I have tried to (setq alert-default-style 'libnotify) but this also does not do anything.

Any ideas on what the problem is?

EDIT:

I have partially solved the problem, though the problem is not with Emacs so this is no longer the best place for support. Anyways ...

If I run:

$ export DBUS_SESSION_BUS_ADDRESS
$ emacs

Then (notifications-notify) works as intended!

However I cannot figure out how to export this variable for the entire KDE session. I tried to put export DBUS_SESSION_BUS_ADDRESS after the exec startplasma-x11 line in my ~/.xinitrc but that did not work.

EDIT2:

I got it to work by launching kde with startx with the following in my ~/.xinitrc.

exec dbus-launch --exit-with-session startplasma-x11

Author
Account Strength
60%
Account Age
2 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,013
Link Karma
332
Comment Karma
588
Profile updated: 3 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago