You are not logged in.

#1 2013-03-21 20:34:19

kellerman
Member
From: Latvia
Registered: 2011-07-20
Posts: 104

System sounds with libcanberra in XFCE and other lighter DE's/WM's?

Hi.
Recently I tought: what if I enable those system sounds (beeps on errors etc...). Well I'm using XFCE and enabling it in the settings panel wont help.
Has someone actually managed this to work? I have no clue how. I'm getting this bug http://bbs.archbang.org/viewtopic.php?id=2210 . After hours of exporting stuff into environment and installing sound themes and different libcanberra libraries I gave up for today.
The article in Arch wiki doesn't actually help and I guess that with GNOME the sounds work by default, not with XFCE.
I tried this in my .xinitrc (exporting the module to GTK_MODULES variable):

if [ -z "$GTK_MODULES" ] ; then     
        GTK_MODULES="libcanberra-gtk-module"
else
        GTK_MODULES="$GTK_MODULES:libcanberra-gtk-module"
fi

and this (exporting GTK path)

GTK_PATH=":/usr/lib/gtk-2.0"
GTK_PATH=":/usr/lib/gtk-3.0"

No sounds!
But for example this works to play a sound in terminal:

canberra-gtk-play -i trash-empty

I have default freedesktop sound theme and libcanberra from arch repos.

Last edited by kellerman (2013-03-21 20:39:10)

Offline

#2 2013-04-04 13:44:06

kellerman
Member
From: Latvia
Registered: 2011-07-20
Posts: 104

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

Really the is not a single person who has got this working on non-gnome environment (I dont know about kde).

Last edited by kellerman (2013-04-04 13:44:29)

Offline

#3 2013-04-05 09:21:14

electric_indigo
Member
Registered: 2011-05-12
Posts: 89

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

I use Xfce and have the sounds working. I never payed much attention to that, few months ago I just noticed some nice bells accompanying the system dialogs, so I don't know what enabled them as I don't really care that much. I use ALSA and have the sound-theme-freedesktop installed. I don't have time to investigate closer now, so here is the list of my installed packages explicitly mentioning “sound” in their description, maybe it will be helpful.

$  pacman -Qs sound | grep \/
local/alsa-lib 1.0.26-1
local/alsa-utils 1.0.26-1
local/libcanberra 0.30-3
local/libmikmod 3.2.0-1
local/libpulse 3.0-3
local/libsndfile 1.0.25-2
local/perl 5.16.3-1 (base)
local/sdl_sound 1.0.3-4
local/sound-theme-freedesktop 0.8-1
local/soundtouch 1.7.1-1
local/sox 14.4.1-1
local/wavegain 1.3.1-1

Edit: typo

Last edited by electric_indigo (2013-04-05 09:21:42)

Offline

#4 2013-04-05 18:01:34

kellerman
Member
From: Latvia
Registered: 2011-07-20
Posts: 104

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

Thanks, I missed 6 packages from them, but nothing changed. Do you have any .gtkrc2.0 or config/gtk3.0/settings.ini files?
And what do you get when you

echo $GTK_MODULES  

?
In XFCE settings the sounds are enabled and in xfce4-settings-editor the theme name is set to freedesktop

I dont even know how to debug the problem. There are no error messages about canberra.

Last edited by kellerman (2013-04-05 18:40:50)

Offline

#5 2013-04-05 20:23:21

electric_indigo
Member
Registered: 2011-05-12
Posts: 89

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

$ echo $GTK_MODULES
canberra-gtk-module

I don't have neither .gtkrc* file in my home directory nor .config/gtk-3.0/settings.ini.
I run i686 if that matters. I also have libcanberra-gstreamer installed (not present in the list I posted before).

It also might be that not all applications support the sounds. In fact, I've just noticed that I actually get system sounds in only few applications, particularly when I close an unsaved document in medit. Similar warning popups in Clementine, Gimp and LibreOffice are totally silent.

Offline

#6 2013-04-05 20:44:28

kellerman
Member
From: Latvia
Registered: 2011-07-20
Posts: 104

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

I tried medit and I get the sound there, yeah, it's GTK2 based as I see, but no sounds in other apps. In Ubuntu there also were beeps when you tried to delete text with backspace and there was nothing more to delete. And when you click on a window which is behind some popup, or other window that takes focus and doesn't let to change to the window below... You get any of these?
I run x86_64, well this seems to be an unresolved issue, I think that many people has this, but just dont want, need or like the sound events.
As I remember on GNOME you get the notifications pretty much everywhere.

Last edited by kellerman (2013-04-05 20:45:28)

Offline

#7 2013-04-05 22:35:21

electric_indigo
Member
Registered: 2011-05-12
Posts: 89

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

Well, turns out I don't get any of the sound effects you mentioned. Then it seems I have the same problem as yours.
But when I think about that now, I'm not quite sure if the vanilla Xfce supports sound themes at all.

Offline

#8 2014-03-20 03:31:46

jmlugo15
Member
Registered: 2013-04-24
Posts: 1

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

Hi, guys. I was reading the thread, and i'm just like you. I'm new at archlinux, but i like the event sounds, in mate it can be configured with mate-media-pulseaudio and mate-settings-daemon (or using dconf). But i'm now using xfce4 and i can't get audio events to work.

Sorry for my english, i'm from venezuela.

Did you discover a solutions??

Offline

#9 2014-03-20 08:43:44

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

System sounds do work well with Xfce.


First: change your sound theme name in Settings Editor to Default. This will use the freedesktop theme (have a look in /usr/share/sounds/freedesktop at index.theme, it will show what theme name to use).

Second: no need to manually set the environment variable GTK_MODULES, as it is set automatically with /etc/X11/xinit/xinitrc.d/40-libcanberra-gtk-module, provided by libcanberra.

Third: Install at-spi and at-spi2-atk. These are the Gnome accessibility libraries and will get the gtk2/3 apps triggering sounds. Ensure you enable them to start in your session autostart files.

Finally: install xdg-utils, this will enable freedesktop "standards" specifications on your system. Freedesktop system sounds being a part of this spec are only assisted with xdg enabled on your system.


Cheers.


[EDIT] Have a look at http://www.freedesktop.org/wiki/Specifi … heme-spec/
This will give you an indepth list of what sound names are currently supported (although not all DE's support all sound names). Playing around with this can help you design your own themes. [/EDIT]

Last edited by Padfoot (2014-03-20 08:47:45)

Offline

#10 2014-03-20 10:37:51

toz
Member
Registered: 2011-10-28
Posts: 497

Re: System sounds with libcanberra in XFCE and other lighter DE's/WM's?

The other piece of this puzzle is understanding which elements of the sound spec are supported by the canberra implementation. From https://gitorious.org/libcanberra/mainl … odule.c#L3:

/*
We generate these sounds:
dialog-error
dialog-warning
dialog-information
dialog-question
window-new
window-close
window-minimized
window-unminimized
window-maximized
window-unmaximized
notebook-tab-changed
dialog-ok
dialog-cancel
item-selected
link-pressed
link-released
button-pressed
button-released
menu-click
button-toggle-on
button-toggle-off
menu-popup
menu-popdown
menu-replace
tooltip-popup
tooltip-popdown
TODO:
drag-start
drag-accept
drag-fail
expander-toggle-on
expander-toggle-off
scroll-xxx
window-switch
window-resize-xxx
window-move-xxx
*/

Offline

Board footer

Powered by FluxBB