Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-12-09 22:09:42

chazb
Member
Registered: 2018-12-04
Posts: 26

Login sound not working [SOLVED]

Running Linux Mint 18.3, Sylvia, XFCE
How do I install or enable "canberra" support? I found a check box in, settings Manager>appearance>settings>enable event sounds. I hover over it and a little window opens telling me I need Canberra support. So I enabled event sounds. I did find the sound in /usr/share/sounds. Now all I need to do is find a way to for login to connect to it and apparently canberra is a part of getting this done.

So further looking on the web I found this,,,,https://www.thelinuxfaq.com/ubuntu/ubuntu-17/gnome-session-canberra
and did as instructed, with this result.
So i followed the link and installed gnome-sessions-canberra, and still have no login sound. Even verified the file with the "locate" command and it is on the system.

charles@charles-Inspiron-1525 ~ $ locate gnome-session-canberra
/usr/share/doc/gnome-session-canberra
/usr/share/doc/gnome-session-canberra/README.gz
/usr/share/doc/gnome-session-canberra/changelog.Debian.gz
/usr/share/doc/gnome-session-canberra/copyright
/var/lib/dpkg/info/gnome-session-canberra.list
/var/lib/dpkg/info/gnome-session-canberra.md5sums

So now it appears I have all the elements but something is still missing.

Last edited by chazb (2018-12-22 06:53:52)

Offline

#2 2018-12-09 22:25:27

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

Have a read through this thread and this longer thread.

If it still doesn't clear it up, can you post back the results of the following commands:

xfconf-query -c xsettings -lv | grep -i sound

env | grep GTK_MODULE

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

which canberra-gtk-play

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 ---

Offline

#3 2018-12-10 21:27:43

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

I am a relative novice, so I am probably going to ask you some dumb questions, to get through this process.
In the "this longer thread" I have already done number.  In number two I have figured out the 'property' /net/usr/share/sounds/purple,,,,and 'type' is a string, but I am certain the 'Value' should be.?.?.
I chose the file purple because it has only 6 sounds in and one of them is the one I want.

Last edited by chazb (2018-12-11 02:56:03)

Offline

#4 2018-12-11 03:00:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

chazb wrote:

In number two I have figured out the 'property' /net/usr/share/sounds/purple,,,,and 'type' is a string, but I am certain the 'Value' should be.?.?.
I chose the file purple because it has only 6 sounds in and one of them is the one I want.

You would just put the name of the sound theme in - in your case just "purple". If you don't get any sound events (I've never come across a purple sound theme), search your package manager for the smooth sound theme (or download it from the internet). It includes many of the available sound effects.

If you still get stuck, post back the results of the commands from my previous post.


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 ---

Offline

#5 2018-12-11 06:58:03

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

charles@charles-Inspiron-1525 ~ $ xfconf-query -c xsettings -lv | grep -i sound
/Net/EnableEventSounds          true
/Net/EnableInputFeedbackSounds  true
/Net/usr/share/sounds/purple    purple
charles@charles-Inspiron-1525 ~ $ env | grep GTK_MODULE
GTK_MODULES=gail:atk-bridge
charles@charles-Inspiron-1525 ~ $ ls /usr/share/sounds/$(xfconf-query -c xsettings -p /Net/SoundThemeName)/stereo
Property "/Net/SoundThemeName" does not exist on channel "xsettings".
ls: cannot access '/usr/share/sounds//stereo': No such file or directory
charles@charles-Inspiron-1525 ~ $ env | grep GTK_MODULE
GTK_MODULES=gail:atk-bridge

I am apperently not getting the theme name right.  Plus that file Purple am not going to use,as there is another file of the same name in the 'share' folder.

charles@charles-Inspiron-1525 ~ $ ls /usr/share/sounds/$(xfconf-query -c xsettings -p /Net/SoundThemeName)/stereo
Property "/Net/SoundThemeName" does not exist on channel "xsettings".
ls: cannot access '/usr/share/sounds//stereo': No such file or directory

Last edited by chazb (2018-12-11 08:01:57)

Offline

#6 2018-12-11 11:33:25

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

The purple sound theme will not work - it is not meant to be used for these kinds of system sounds.

Download the smooth sound theme and extract it to .local/share/sounds. When this is complete, run the following command:

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

You also don't have the canberra-gtk-module set. Add this to the end of your ~/.profile file:

GTK_MODULES="$GTK_MODULES:canberra-gtk-module"
export GTK_MODULES

Make sure some needed packages are installed:

sudo apt-get install gnome-session-canberra sox

Log out and back in again. Make sure that the "System Sounds" volume is turned up on your volume control's playback tab.


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 ---

Offline

#7 2018-12-11 21:32:00

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

I am using Xfce because I am using old hardware Dell Inspiron 1525, and LM 18.3 Cinnamon does not work well with old hardware. I thought it would be nice to have event sounds and there are a mess already on the system.  I can see that I have a lot of learning yet to do. How to set "canberra-gtk-module". like does tilde forward slash .profile set it?
So far I have one sound, a popping noise when I opon Thunderbird.

I am in no big fat hurry to get this done. I use this forum and Linux Mint forum to learn how to use Linux Mint.  You have been helpful and for this I Thank You.  Have a Merry Christmas.

Offline

#8 2018-12-18 20:35:16

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

I am at the outer limit of my command line knowledge. So I am over at https://www.computerhope.com/unix/uset.htm ,looking at the set and unset commands. How would I set the gtk-module?

You said. "Add this to the end of your ~/.profile file" profile file?

I now have the, Smooth package in /usr/share/sounds I had had to log in as root to get it there as sudo didn't have permission.  Been using the LinuxMint Forum.

Offline

#9 2018-12-18 22:49:39

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

chazb wrote:

How would I set the gtk-module?

You said. "Add this to the end of your ~/.profile file" profile file?

Edit the hidden .profile file in your home directory using the text editor of your choice and copy paste the below into the file at the end:

GTK_MODULES="$GTK_MODULES:canberra-gtk-module"
export GTK_MODULES

Save the file. Log out and back in again.

To check that it took effect, run the following command:

env | grep GTK_MODULES

...and make sure that canberra-gtk-module is listed.


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 ---

Offline

#10 2018-12-19 06:48:22

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

Well I am learning again I didn't that,,,,,tilde forward slash,~/ is short hand for Home Directory.

This is the last few lines of my ~/.profile, as I am not certain I put the GTK line in the right spot;

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
GTK_MODULES="$GTK_MODULES:canberra-gtk-module"
export GTK_MODULES

I did log out and log in.
Lastly this is the out put of the env command;

charles@charles-Inspiron-1525 ~ $ env | grep GTK_MODULES
GTK_MODULES=:canberra-gtk-module:gail:atk-bridge

Last edited by chazb (2018-12-19 08:49:00)

Offline

#11 2018-12-19 11:33:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

That looks good.

Can you post back the results of the following commands:

xfconf-query -c xsettings -lv | grep -i sound

env | grep GTK_MODULE

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

which canberra-gtk-play

Also, run the following command and see if you hear anything:

canberra-gtk-play -i desktop-login

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 ---

Offline

#12 2018-12-20 04:46:02

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

charles@charles-Inspiron-1525 ~ $ xfconf-query -c xsettings -lv | grep -i sound
/Net/EnableEventSounds          true
/Net/EnableInputFeedbackSounds  true
/Net/SoundThemeName             Mint-X
/usr/share/sounds/Smooth        Smooth
charles@charles-Inspiron-1525 ~ $ env | grep GTK_MODULE
GTK_MODULES=:canberra-gtk-module:gail:atk-bridge
charles@charles-Inspiron-1525 ~ $ ls /usr/share/sounds/$(xfconf-query -c xsettings -p /Net/SoundThemeName)/stereo
ls: cannot access '/usr/share/sounds/Mint-X/stereo': No such file or directory
charles@charles-Inspiron-1525 ~ $ which canberra-gtk-play
/usr/bin/canberra-gtk-play
'
charles@charles-Inspiron-1525 ~ $ canberra-gtk-play -i desktop-login
Failed to play sound: File or data not found

Last edited by chazb (2018-12-20 04:46:54)

Offline

#13 2018-12-20 05:07:51

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

The sound theme isn't set up properly. Run:

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

...then try to play:

canberra-gtk-play -i desktop-login

...to see if you hear a sound.

BTW: to add code tags, use [ c o d e ] and [ / c o d e ] (without the spaces) instead of "code" and "/code".


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 ---

Offline

#14 2018-12-21 05:15:25

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

charles@charles-Inspiron-1525 ~ $ xfconf-query -c xsettings -p /Net/SoundThemeName -s Smooth
charles@charles-Inspiron-1525 ~ $ canberra-gtk-play -i desktop-login

The command played the log in sound sound.
So I got a bit excited and did a reboot and no login sound yet in real time.  But some sounds, thumps, bips,and chirps when I do stuff on the computer. Plus I had KourlorPaint open earlier and I was getting sounds there as well.

This is what xsettings look like.


Property                               Type   Locked   Value

    SoundThemeName                     String     *   Smooth
 
    ThemeName                          String     *   Mint-X

osr                                   Empty      *

   share                               Empty      *

      sounds                           String     *   Smooth


This is a represententation of my xsettings in the Setting Editor as I see it. the astricts represent empty boxes. Imagen a down arrow next to user and share,

Last edited by chazb (2018-12-21 06:07:20)

Offline

#15 2018-12-21 12:58:43

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

chazb wrote:

So I got a bit excited and did a reboot and no login sound yet in real time.

To get a login sound, go to Settings Manager > Session and Startup > Autstart Applications and create a new entry called "Login Sound" with the command set to:

canberra-gtk-play -i desktop-login

...then logout and back in again to test.


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 ---

Offline

#16 2018-12-21 20:22:23

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

Okay my friend you can pat yourself on the back for me as you have done a good service this day.  Thank You I got the login sound, as well as a variety of other sounds, making Xfce a bit more than a bare bones desktop.
I am thinking we are done, but if we are not or we need to tidey something up, please let me know.

Last edited by chazb (2018-12-21 20:42:02)

Offline

#17 2018-12-21 20:43:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

chazb wrote:

Okay my friend you can pat yourself on the back for me as you have done a good service this day.  Thank You I got the login sound, as well as a variety of other sounds, making Xfce a bit more than a bare bones desktop.
But,,,, Setting Manager > Session and Startup >Autostart Applications, was a bit of an eye opener in the list of  unchecked entries is a entry for "indicator sound'.  I took a while to find the unmarked button which would allow me to create a new entry.  In the New Entry Box is a small button that opens a Select Command window, and at the of the list is login.wav.

That must be something specific to the distro you are using. In the command box, you could just put:

canberra-gtk-play -i desktop-login

...and this will play the sound theme's login sound. This way, if you change the sound theme, it will play the new sound theme's login sound.

Is Checking the "event sounds" in Settings Manager> Apperiences, getting Libcanberra and Gtx_moduale Canberra, setting the file location in xsetting, and finally turning it all on in Autostart Applications, all that I need to do? If so, why am I bothering with Smooth?

"Smooth" provides the "variety of other sounds". There are other (not many, but some) sound themes that you can use. And you can create your own. The sound theme is the organizational structure that defines and provides these sounds as a packaged set of sounds.


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 ---

Offline

#18 2018-12-21 21:07:48

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

I tried the same thing with logout sound and I didn't work.  Is there a difference between login and logout?

Last edited by chazb (2018-12-21 21:08:47)

Offline

#19 2018-12-21 23:15:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

chazb wrote:

I tried the same thing with logout sound and I didn't work.  Is there a difference between login and logout?

Yes. The functionality to run something on logout does not exist in Xfce. There are bug reports about this.

You can use a workaround. However, it looks like Mint is doing something else that prevents this from working. Have a read through this thread to see the issue.

I believe the way to get around this is to:

  1. rename the existing xfce4-session executable:

    sudo mv /usr/bin/xfce4-session /usr/bin/xfce4-session.orig
  2. create a new /usr/bin/xfce4-session file with the following content:

    #!/bin/bash
    /usr/bin/xfce4-session.orig
    canberra-gtk-play -i desktop-logout
  3. make the file executable:

    sudo chmod +x /usr/bin/xfce4-session

Note that whenever the xfce4-session package is updated by Mint, you'll have to repeat these steps.


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 ---

Offline

#20 2018-12-22 06:52:38

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

Thanks for your help, I think in the interest of my sanity I will not attempt log out sounds.

Offline

#21 2019-01-21 19:47:09

chazb
Member
Registered: 2018-12-04
Posts: 26

Re: Login sound not working [SOLVED]

Hi again I hope you had a Merry Christmas and a Happy New Year.  I know that even though I have marked this issue solved, if I had to explain why it is solved, I would be hard pressed to do so.  While I understand enabling "event sounds" in the Setting Manager and creating the path to the sound file in xsettings, plus having the libcanberra packages present in the system, what I don't understand is what to do with the Canberra-Gtk Module.
I have sort of figured out GTK modules in general are used to make stuff happen. 

So could you, would you help me in this endeavour please?

Offline

#22 2019-01-21 21:51:32

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

chazb wrote:

what I don't understand is what to do with the Canberra-Gtk Module.

Xfce supports event sounds using the libcanberra protocol which in itself is an implementation of the XDG sound theme specification. The module is the program that ties into the GTK internals to track and report when certain GTK events (button press, menu open, etc) happen and to then emit the corresponding sound.

More information can be found here/


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 ---

Offline

#23 2023-03-26 17:17:37

PureBlood
Member
Registered: 2023-03-26
Posts: 2

Re: Login sound not working [SOLVED]

ToZ wrote:

Yes. The functionality to run something on logout does not exist in Xfce. There are bug reports about this.

You can use a workaround. However, it looks like Mint is doing something else that prevents this from working. Have a read through this thread to see the issue.

I believe the way to get around this is to:

  1. rename the existing xfce4-session executable:

    sudo mv /usr/bin/xfce4-session /usr/bin/xfce4-session.orig
  2. create a new /usr/bin/xfce4-session file with the following content:

    #!/bin/bash
    /usr/bin/xfce4-session.orig
    canberra-gtk-play -i desktop-logout
  3. make the file executable:

    sudo chmod +x /usr/bin/xfce4-session

Note that whenever the xfce4-session package is updated by Mint, you'll have to repeat these steps.

Hello ToZ!

Thank you very much for sharing your knowledge.

After hours of reading through forums, I was finally able to activate a LOGIN sound, with the code you shared on a previous message, as a Startup Application Shortcut. (Many other previous codes had failed.)

I just tried to implement your proposed workaround to also activate a LOGOUT sound and, sadly, it didn't work for me.

My system is running Linux Mint 20.3, Una (Xfce ofc.)

It's been like FOUR years since you wrote this and it still helped me. So I created this account and I'm writing to you to thank you lol! And also to ask you if, after all this time, maybe you've been able to find an effective way to activate a logout sound on LM Xfce?

Thanks a lot man, hope you have a great day.

Last edited by PureBlood (2023-03-26 17:18:43)

Offline

#24 2023-03-26 19:04:38

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Login sound not working [SOLVED]

The newer versions of Xfce now support RunHook Triggers. On the Application Autostart tab, for any particular entry, you can set a trigger for the application. Supported triggers include: login, logout, restart, shutdown, suspend, hibernate, hybrid sleep, switch user. Meaning, you can assign a logout trigger/command to any of those events.

Now for the bad news. Logout/shutdown/reboot triggers don't work exactly as expected. When you issue one of these actions, xfce4-session will run the appropriate triggers and start shutting down the system. Once the services are shutdown, and if the trigger is long running, it will lose access to those services. A good example of this is using canberra-gtk-play in this situation - the canberra GTK module gets disabled relatively early and it the command won't work.

As a workaround, you could use another play command - I have "playsound" installed (from an SDL library) and that works, but only if I also add in a sleep command to force delay xfce4-session:

sh -c "sleep 2 & playsound /usr/share/sounds/Smooth/stereo/desktop-logout.oga"

This works for me to play a short logout/shutdown/restart sound. There may be other play commands that will work in this instance as well.


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 ---

Offline

#25 2023-03-27 00:59:18

agashamu
Member
From: California
Registered: 2021-03-01
Posts: 136

Re: Login sound not working [SOLVED]

Hi ToZ, I tried. It works with "play" but only for logout. Restart and shutdown starts playing but stops right after a tiny bit of sound played.


Linux Mint Xfce 21.1

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 8 queries executed - Memory usage: 694.31 KiB (Peak: 743.16 KiB) ]