Im desperate to get notification sound from messages. I failed

There is no notification sound at all on the linux kde desktop when you receive messages. I have tried all sorts to create one. I failed, can someone please help.

I tried to grab the pop-up notification so i could write some code to fire a sound.

I tried

  • wmctrl
  • xdotool
  • xwininfo
  • xprop

The pop-up notification windows just does not have anything that i can “grab” onto, no name, no class, no id, no nothing. I can not poll the screen continually to look for the pop-up and make a sound if it shows because i just can’t test for it.

So i tried to figure where in the source the notification is fired. If i was forced to guess i would say it is in
/src/gui/systray.cpp line 517 QSystemTrayIcon::showMessage(title, message, icon);

So i tried adding this just before that line.

QSound sound("/path/to/sound/file.wav");
sound.play();

I do not know how to test it without building it and i failed at trying to build it, it says
/home/greg/Downloads/desktop-master/src/gui/systray.cpp:518: undefined reference to QSound::QSound(QString const&, QObject*)'`

I have added the #include <QtMultimedia/QSound> but still fails

I dont know how to proceed :frowning:

Screenshot_20230605_105209

Hmm, I see sound support was recently added. Unsure of how to use it.

Hmm, I don’t know either. It looks like you install it as an app on the Nextcloud server, and it provides a notification API. Then, I assume you build your own local app to use this API.

I really don’t know. It’s an interesting comment though. I didn’t even know this repository existed, but unfortunately, I wouldn’t know what to do with it.

Notifications app is built into nextcloud. Also try the new desktop talk app, but it doesn’t support sound notifications yet

1 Like

I honestly dont know. I think that half the time they just assume that if they trigger a native notification for whatever OS / DE that it should handle the sound natively. Well KDE does but not in the way that they think.

Looking a bit longer at your post i believe that that is just going to affect the server not the client apps. I think the “Desktop” app in my case would have to be altered for it to have sound.

But what do i know :frowning: lol.

Yea iv looked at the new “Talk” that they are working on. It just a electron / chromium backend with Talk loaded on top. Does not even have browser notifications yet

1 Like

Sorry for multi posts, im way behind reading what your posting :smile:

But yea, If they could implement all of them enhancements and it worked on linux KDE then that would be the holy grail for me.

Screenshot_20230605_140119

I shall keep watching.

1 Like

Yeah, this just doesn’t make sense. I mentioned this in the linked Github PR, but this was merged as though the feature was implemented. It is not. If someone calls me using Spreed, I get a ringtone. This is how I know Nexcloud/Spreed can play a sound without me initiation an action in my browser. I’m on Chromium and the incoming call sound works just fine with no initiated action from me.

Yet, chat notifications do not play a sound at all.

1 Like

Yea, i was intending to use nextcloud for my family/friends but there is just too much wrong that they won’t accept.

I’m also using KDE with Chat. No sound on chats yet. Any progress from anyone?

Nothing that I’m aware of, sorry.

I ended up writing a script that continually watches for the notification GUI (any notification GUI, because there is no way to tell if its the one I’m looking for) and then using “tesseract” OCR on it to look for specific words like “Nextcloud” and “message”.

It’s far from perfect, but i don’t see any alternative.