Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-12-28 17:18:13

jcubic
Member
Registered: 2011-02-13
Posts: 10

Sound notifications for XFce

Hi,

Is there a way other then modifying Xfce Notification Daemon source code to add sound to system notifications like on windows 10?

Offline

#2 2016-12-28 17:36:13

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Sound notifications for XFce

Hello and welcome.

Have a read through this thread for information on how to enable sound effects in Xfce.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#3 2016-12-28 18:28:12

jcubic
Member
Registered: 2011-02-13
Posts: 10

Re: Sound notifications for XFce

Thanks for the reply.

I set everyting like in that tread and I have sounds, when I got error dialog, but no sound when I'm running `notify-send "hello"`. Should I have sound when I call that command, because I want to be notified for instance when I got new email from claws-mail that send notification.

Last edited by jcubic (2016-12-28 18:29:25)

Offline

#4 2016-12-28 18:55:43

jcubic
Member
Registered: 2011-02-13
Posts: 10

Re: Sound notifications for XFce

I've just got new email and get sound. Great. Thanks.

Last edited by jcubic (2016-12-28 18:56:01)

Offline

#5 2017-01-02 18:12:24

annoying_daniel
Member
Registered: 2017-01-02
Posts: 15

Re: Sound notifications for XFce

I did the best I could at following the guide, but I'm having some issues as well if @ToZ could entertain some troubleshooting... smile

MountainDewManiac wrote:

summons please, if you've ever figured this out...

My setup: Mint 18, Xfce v4.12.

xfconf-query -c xsettings -p /Net/SoundThemeName

Borealis

(I noticed for your linked tar, the install.sh script was inside the "stereo" folder, so the script simply installed the Borealis folder with all the files except without a stereo folder or the "index.theme" file. So, trying again, I uninstalled and moved the install script 1 level up and that time it installed the correct structure, although you need to add 755 permissions manually on the stereo folder. All of the files can normally be accessed and played.)

env | grep GTK_MODULE

GTK_MODULES=canberra-gtk-module:canberra-gtk-module:gail:atk-bridge

(gail and atk-bridge are apparently defaults on my system?)

ls /usr/share/sounds/$(xfconf-query -c xsettings -p /Net/SoundThemeName)/stereo

button-pressed.ogg        device-added.ogg        K3b_success.ogg          service-login.ogg   window-close.ogg
button-toggle-off.ogg     device-removed.ogg      Knock.ogg                service-logout.ogg  window-maximized.ogg
button-toggle-on.ogg      dialog-error.ogg        Kopete_status.ogg        Startup1_1.ogg      window-minimized.ogg
desktop-login.ogg         dialog-information.ogg  message-new-instant.ogg  Startup1_2.ogg      window-unmaximized.ogg
desktop-logout.ogg        dialog-question.ogg     phone-incoming-call.ogg  Startup1_3.ogg      window-unminimized.ogg
desktop-switch-left.ogg   dialog-warning.ogg      phone-outgoing-busy.ogg  system-ready.ogg
desktop-switch-right.ogg  Exit1_2.ogg             README                   trash-empty.ogg

which canberra-gtk-play

/usr/bin/canberra-gtk-play

"Enable event sounds" is checked.
Here's xfconf: https://imgur.com/mErl9YU
"52libcanberra-gtk-module_add-to-gtk-modules" and "52libcanberra-gtk3-module_add-to-gtk-modules" were manually created with the respective code.
sox and gnome-session-canberra are installed by default.
System sounds are at 100%. In Thunderbird (just as before), both the default and custom sounds are working for the "new mail" notification sound. Btw, what sound is supposed to play on a "popup notification"? This is what I'm really after...I noticed there are several "themes" there you can chose the style of. And yes, I rebooted several times.

I'm at a loss. Any hints?

Last edited by annoying_daniel (2017-01-02 18:17:10)

Offline

#6 2017-01-02 22:35:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Sound notifications for XFce

To confirm, you are getting no system sounds (outside of the Thunderbird sounds)?

What does the following command do when run from a terminal window:

canberra-gtk-play -i Startup1_1

Do you hear the startup sound?

Btw, what sound is supposed to play on a "popup notification"?

What are you calling a "popup notification"? The notifyd notifications? If so, I don't believe they support sound events.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#7 2017-01-02 22:47:59

annoying_daniel
Member
Registered: 2017-01-02
Posts: 15

Re: Sound notifications for XFce

ToZ wrote:

To confirm, you are getting no system sounds (outside of the Thunderbird sounds)?

What does the following command do when run from a terminal window:

canberra-gtk-play -i Startup1_1

Do you hear the startup sound?

Btw, what sound is supposed to play on a "popup notification"?

What are you calling a "popup notification"? The notifyd notifications? If so, I don't believe they support sound events.

canberra-gtk-play -i Startup1_1
Failed to play sound: File or data not found
...it's there, although atm I reinstalled Borealis with your original directory structure because you mentioned this was a gnome2 hack or something and was trying out various things. Mint 18 is in the middle of a gtk3 transition period, although it's more "involved" on 18.1.

And that's disappointing about notifyd not having audio support, that was my goal all along. The twitter client Corebird has no audio notification support but uses notifyd for notifications (I believe this is the case.) If you're like me, you have a million things open at once and sometimes you just need to rely on audio alerts to get your attention.

Offline

#8 2017-01-02 23:02:42

annoying_daniel
Member
Registered: 2017-01-02
Posts: 15

Re: Sound notifications for XFce

annoying_daniel wrote:
ToZ wrote:

To confirm, you are getting no system sounds (outside of the Thunderbird sounds)?

What does the following command do when run from a terminal window:

canberra-gtk-play -i Startup1_1

Do you hear the startup sound?

Btw, what sound is supposed to play on a "popup notification"?

What are you calling a "popup notification"? The notifyd notifications? If so, I don't believe they support sound events.

canberra-gtk-play -i Startup1_1
Failed to play sound: File or data not found
...it's there, although atm I reinstalled Borealis with your original directory structure because you mentioned this was a gnome2 hack or something and was trying out various things. Mint 18 is in the middle of a gtk3 transition period, although it's more "involved" on 18.1.

And that's disappointing about notifyd not having audio support, that was my goal all along. The twitter client Corebird has no audio notification support but uses notifyd for notifications (I believe this is the case.) If you're like me, you have a million things open at once and sometimes you just need to rely on audio alerts to get your attention.

Ok holdup, canberra-gtk-play -i Startup1_1 is now working when the directory structure is properly in place. Now what?

Last edited by annoying_daniel (2017-01-02 23:03:18)

Offline

#9 2017-01-02 23:09:30

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Sound notifications for XFce

Log out and back in again and see if you can get the other sound effects to work (window open, window close, etc). There aren't too many sound effects available (see: http://git.0pointer.net/libcanberra.git … dule.c#n41) because the canberra sound implementation was never completed and hasn't been really worked on since 2012. See: http://0pointer.de/lennart/projects/libcanberra/ and http://git.0pointer.net/libcanberra.git/.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#10 2017-01-02 23:21:43

annoying_daniel
Member
Registered: 2017-01-02
Posts: 15

Re: Sound notifications for XFce

ToZ wrote:

Log out and back in again and see if you can get the other sound effects to work (window open, window close, etc).

Not a peep. I'm guessing this is another Minty quirk...I noticed in the session and startup apps that "indicator application" and "indicator sound" are both unselected...could that be it?

Offline

#11 2017-01-02 23:53:26

annoying_daniel
Member
Registered: 2017-01-02
Posts: 15

Re: Sound notifications for XFce

Ok I have the basic window sounds, turns out "enable input feedback sounds" in Appearance -> Settings also needed to be checked as well. Still no login/logout sound but don't really care.

edit: I'm also noticing the notification sounds still suffer from a directional problem to where they originate on-screen. For example, on a dual monitor setup, if you do an action on a small window in the left corner of monitor #1, the sound almost exclusively comes from the left-ear headphone. Vice-versa on the other side.

Last edited by annoying_daniel (2017-01-02 23:57:48)

Offline

#12 2017-01-03 01:40:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Sound notifications for XFce

annoying_daniel wrote:

Ok I have the basic window sounds, turns out "enable input feedback sounds" in Appearance -> Settings also needed to be checked as well.

Interesting. I've never had to enable that setting to get the sound effects to work, but good that it worked for you.

Still no login/logout sound but don't really care.

If you want a login sound, create a startup application that runs something like:

play -q <path/to/soundfile>

...I find that the canberra utilities don't work on startup - maybe because they are not yet initialized. To get a logout sound, you'll have to patch xfce4-session - I can provide more info on this if you want.

edit: I'm also noticing the notification sounds still suffer from a directional problem to where they originate on-screen. For example, on a dual monitor setup, if you do an action on a small window in the left corner of monitor #1, the sound almost exclusively comes from the left-ear headphone. Vice-versa on the other side.

I'll have to check this tomorrow when I'm on my dual monitors at work. I've never noticed it before.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Online

#13 2017-01-03 19:20:06

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: Sound notifications for XFce

annoying_daniel wrote:

I'm also noticing the notification sounds still suffer from a directional problem to where they originate on-screen. For example, on a dual monitor setup, if you do an action on a small window in the left corner of monitor #1, the sound almost exclusively comes from the left-ear headphone. Vice-versa on the other side.

I haven't been interested in system sounds for quite a while (silence is golden wink ) - and I am not currently using multiple monitors - so this is just a guess, but...

What you described reads suspiciously like a feature. System noise in left ear, look for the event on the left monitor; system noise in right ear, look for the event on the right monitor. For those with a third (center) monitor, maybe it plays the system sound at equal volume from both speakers, lol?

Such a behavior wouldn't help me because I can barely hear a phone ring with my left ear, but it might save some people many fractions of a second (over the course of a lifetime, lol).

There might even be a (possibly hidden and unknown) setting that controls this.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#14 2017-01-04 09:28:40

annoying_daniel
Member
Registered: 2017-01-02
Posts: 15

Re: Sound notifications for XFce

MountainDewManiac wrote:
annoying_daniel wrote:

I'm also noticing the notification sounds still suffer from a directional problem to where they originate on-screen. For example, on a dual monitor setup, if you do an action on a small window in the left corner of monitor #1, the sound almost exclusively comes from the left-ear headphone. Vice-versa on the other side.

I haven't been interested in system sounds for quite a while (silence is golden wink ) - and I am not currently using multiple monitors - so this is just a guess, but...

What you described reads suspiciously like a feature. System noise in left ear, look for the event on the left monitor; system noise in right ear, look for the event on the right monitor. For those with a third (center) monitor, maybe it plays the system sound at equal volume from both speakers, lol?

Such a behavior wouldn't help me because I can barely hear a phone ring with my left ear, but it might save some people many fractions of a second (over the course of a lifetime, lol).

There might even be a (possibly hidden and unknown) setting that controls this.

Regards,
MDM

You're probably right, but this is one of those quirks where designers are thinking this is a good idea, but most people are just annoyed by it -- kinda like the "window roll-up" feature. Sure it can be useful for a small number of people, but just keep it off by default. I actually posted this as a "bug" way back in June when Mint MATE 18 beta came out, here's the screenie I made for the one time you can have a "balanced" audio level, lol: https://imgur.com/ZfudQWK

Maybe after trying all these DEs, I'll just capitulate and use gnome3 on some...moderate-level distro. Maybe even Fedora. I also wish XFCE had better-behaving desktop icons that don't shift on every reboot and they really need to change the way they look when dragging and dropping to folders/into-other-icons...I get really paranoid now when re-arraigning my desktop icons because I don't want Transmission to "open" Thunderbird, lol -- because the target icon never changes its appearance. XFCE honors Fitts' law on the dark window themes, and that's the absolute most-important item to me when it comes to UI design.

Anyway back on-topic and talking about popup notification audio alerts, there's gotta be a python script out there that sits in the background and monitors when "notify-send" is invoked, and then proceeds to play via sox the alert sound of your choice, that would be really nice to have. smile

Last edited by annoying_daniel (2017-01-04 09:59:48)

Offline

#15 2017-03-15 03:27:40

annoying_daniel
Member
Registered: 2017-01-02
Posts: 15

Re: Sound notifications for XFce

Still rocking xfce after moving up the linux chain...now on Antergos. I find this DE (xfce) has the least amount of problems big_smile and hope it will be continued to be developed upon. Manjaro comes with xfce by default and I sincerely hope more people will come onto the Arch train -- this is Linux at its best imo. Rolling release, freshest of the fresh.

ToZ wrote:

The notifyd notifications...I don't believe they support sound events.

You know I should really do some research before assuming things like this. This request is over a year old with no response: https://bugzilla.xfce.org/show_bug.cgi?id=12418 ...if you have any weight in development community, can I ask you a favor and nudge the devs to work on this functionality? It would be the best. smile

Offline

#16 2021-08-14 06:18:00

valkyrie
Member
Registered: 2021-08-14
Posts: 1

Re: Sound notifications for XFce

Coming from Openbox on Ubuntu server, I used to use Dunst for audible desktop notifications. I've found that if I replace xfce4-notifyd with Dunst, I can do the same in XFCE as well. The first step is to replace xfce4-notifyd with Dunst:

sudo apt remove xfce4-notifyd
sudo apt purge xfce4-notifyd
sudo apt autoremove
sudo apt install dunst
sudo reboot

Then copy the config file for Dunst to your home config folder. You may need to make the required directory structure with mkdir ~/.config etc...

cp /etc/xdg/dunst/dunstrc ~/.config/dunst/dunstrc

Then add the following lines to the end of ~/.config/dunst/dunstrc

[play_sound]
    summary = "*"
    script = alert.sh

Next you need to create the alert.sh script. It should be executable, and the path can be specified in /etc/environment. If you're just now adding the path variable to /etc/environment, a logout/login is required for it to be imported. You also may have to install ffmpeg to get ffplay, or modify the script below to use a different media player that is installed. Update the path and sound file name in the script below to match your setup. The alert.sh script should looks like this:

#!/bin/bash
ffplay -nodisp -autoexit /path/to/audio/file/alert.oga

restart dunst to reload updated config file:

sudo killall dunst

Dunst will restart automatically when it receives a notification. That should be it. All desktop notifications will play an alert sound now.

Offline

Board footer

Powered by FluxBB