Would you like to react to this message? Create an account in a few clicks or log in to continue.

2 posters
  • Post new topic
  • Reply to topic

SOLVED: Can't turn on system sounds in XFCE

avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Can't turn on system sounds in XFCE Empty SOLVED: Can't turn on system sounds in XFCE

Post by davecs 10th July 2024, 6:05 pm

Does anyone know how to turn on System Sounds in XFCE in PCLOS Debian?

I've tried removing JamesDSP and adding a file to ensure that Canberra is running as in this post:
https://www.pclinuxos.com/forum/index.php/topic,151285.msg1292680.html

I've also tried installing libcanberra alongside libcanberra3. I've turned on the system sounds in the XFCE Settings Editor > xsettings > Net > EnableEventSounds/EnableInputFeedbackSounds/SoundThemeName.

I've installed PavuControl, and it shows that the are system sounds, but there is only a volume slider, not a level meter, and I can't hear them.

Can anyone help?

Just to confirm that all other sounds are working correctly.


Last edited by davecs on 14th July 2024, 2:04 pm; edited 1 time in total
Upgreyed
Upgreyed
Admin


Posts : 147
Join date : 2024-05-12
Location : The Sunshine State FL USA

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Upgreyed 13th July 2024, 1:47 pm

The current pclos debian xfce iso is working with the system sounds "Enchanted" theme as the default but is turned off by default.
If you don't want to just download the current iso you can manually add these files to get the sounds working on your install:
The freedesktop theme does not work or I could not get it to work correctly in xfce?

Step 1

Install gnome-session-canberra, libcanberra-gtk-module, gir1.2-gsound-1.0
Download  
Unzip it and copy the Enchanted folder to /usr/share/sounds

Step 2
Create this file
Code:
# This file is sourced by Xsession(5), not executed.

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

export GTK_MODULES
Name it "52libcanberra-gtk-module_add-to-gtk-modules" and add it to /etc/X11/Xsession.d folder

Step 3

Enable the sounds
Settings Manager > Setting Editor > xsettings  > Tick on EnableEventSounds, EnableInputFreedbackSounds
Edit and add the SoundThemeName "Enchanted" (without quotes).
avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by davecs 13th July 2024, 6:23 pm

YES! This all works! I have system sounds!

I've got a couple of my own scripts for you, which you might want to try.

This one I've called xfce4-set-sound-theme and I've put it in /usr/local/bin/ . It enables a user to select a sound theme from inside the XFCE settings manager, from a drop-down menu. It will look in /usr/share/sounds/ and ~/.local/share/sounds/ for suitable sound layouts.

Code:

#!/bin/bash

#We need to create a list of soundfile directories with an "index.theme" file.

#start up a file with the names, plus the option "None"
echo -n "None" > /tmp/soundlist.txt

#look in the system sounds theme area.
cd /usr/share/sounds

for g in *; do

    if [ -d ${g} ]; then
        cd $g
#folders without an "index.theme" file are ignored.
        if [ -f "index.theme" ]; then
#the following line  is to extract the sound name from index.theme. I found this didn't work,
#and that the actual folder name was preferred by XFCE4. It must not contain spaces.
#           echo -n "!"$( cat index.theme | grep Name= | cut -c 6- ) >> ~/tmp/soundlist.txt

#just list by folder names.
            echo -n "!""${g}" >> /tmp/soundlist.txt
        fi
        cd ..
    fi
done

#look for sounds in user sounds theme area. First check that folder exists
xyz=~/.local/share/sounds

if [ -d $xyz ] ; then

    cd $xyz

    for g in *; do

        if [ -d ${g} ]; then
            cd $g
            if [ -f "index.theme" ]; then
                echo -n "!""${g}" >> /tmp/soundlist.txt
            fi
            cd ..
        fi
    done
fi
#we now have a list of entries for yad, with None, then system sounds in order,
#then local sounds in order. Make sure that all sounds have different names! We
#will pass text to XFCE4, and it will just use the first match it finds.

soundset=$(echo `cat ~/tmp/soundlist.txt`)
abc=`yad --width=450 --title="Select System Sounds"  \
--image="/usr/share/icons/sound_section.png" \
--text="Current Sound Theme is: $( xfconf-query -c xsettings -p /Net/SoundThemeName )" \
--form --item-separator="!" \
--field="Select New Theme":CBE \
"$soundset" `

#test for "cancel"...
if [ "$abc" != "" ] ; then

#yad returns a string with an extra "|" at the end, so we have to remove it.
    chosensound=$(echo -n "$abc" | rev | cut -c 2- | rev )

#Turn sounds off if "None" selected
    if [ "$chosensound" == "None" ] ; then
  
        xfconf-query -c xsettings -p /Net/EnableEventSounds -s false
        xfconf-query -c xsettings -p /Net/EnableInputFeedbackSounds -s false
  
    else

#Turn sounds on if one selected
        xfconf-query -c xsettings -p /Net/EnableEventSounds -s true
        xfconf-query -c xsettings -p /Net/EnableInputFeedbackSounds -s true
  
    fi

#Set your chosen sound. I have used the command that forces a new Property to be created
#if there's not one already.

    xfconf-query -c xsettings -p /Net/SoundThemeName -n -t string -s "$chosensound"
  
fi

And the following file, placed in /usr/share/applications is the one that puts it in the XFCE Settings Manager:

I've used the "click-radio" icon here though you might want to use a different one.

Code:

[Desktop Entry]
Name=Sound Theme
Comment=Select a new Sound Theme
Exec=xfce4-set-sound-theme
Icon=click-radio
Terminal=false
Type=Application
Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-PersonalSettings;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
GenericName=Sound Theme Selector

The category line illustrates how to add any app to the XFCE settings manager.

As you can see, I'm not great at writing scripts, but this does get the job done.

Upgreyed likes this post

Upgreyed
Upgreyed
Admin


Posts : 147
Join date : 2024-05-12
Location : The Sunshine State FL USA

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Upgreyed 13th July 2024, 6:35 pm

Not sure what the best default theme should be used on the xfce iso. I am sure whatever is used some will like it and some won't. The Enchanted theme is
not my favorite but it will do for now unless you or someone has a better idea to change out the default theme we have now? Wink
avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by davecs 13th July 2024, 6:47 pm

My favourite is "Smooth". I think I originally downloaded it from a site called xfce-look or something similar, I just did a search and found it here:

https://www.pling.com/p/1187979/

Upgreyed
Upgreyed
Admin


Posts : 147
Join date : 2024-05-12
Location : The Sunshine State FL USA

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Upgreyed 13th July 2024, 6:56 pm

davecs wrote:My favourite is "Smooth". I think I originally downloaded it from a site called xfce-look or something similar, I just did a search and found it here:

https://www.pling.com/p/1187979/

I like most of the sounds myself but not the robot ones. Maybe we or someone can come up with a good one as I like some of the KDE ones also. Mix and match. Very Happy
Upgreyed
Upgreyed
Admin


Posts : 147
Join date : 2024-05-12
Location : The Sunshine State FL USA

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Upgreyed 14th July 2024, 8:27 am

@ davecs,

To make it a bit easier for some, I took your script and added xfce-sound-changer_1.0.1-1pclos_all.deb to the repository. Thanks! Cool


Last edited by Upgreyed on 14th July 2024, 3:05 pm; edited 1 time in total
avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by davecs 14th July 2024, 9:57 am

Upgreyed wrote:@ davecs,

To make it a bit easier for some, I took your script and added xfce-sound-changer_1.0.1-1pclos_all.deb to the repository. Thanks! Cool

That's OK. Now you have made changes to the iso to enable sounds, and added this applet, I'm wondering if it's worth re-installing from the latest iso to see how it all goes with a new installation. Would that be helpful?
Upgreyed
Upgreyed
Admin


Posts : 147
Join date : 2024-05-12
Location : The Sunshine State FL USA

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Upgreyed 14th July 2024, 10:03 am

davecs wrote:
Upgreyed wrote:@ davecs,

To make it a bit easier for some, I took your script and added xfce-sound-changer_1.0.1-1pclos_all.deb to the repository. Thanks! Cool

That's OK. Now you have made changes to the iso to enable sounds, and added this applet, I'm wondering if it's worth re-installing from the latest iso to see how it all goes with a new installation. Would that be helpful?
The xfce-sound-changer pkg install from synaptic will set the xfce-sound-changer config file and pull in the needed dependencies. No configuration should be required if someone has a xfce install without the latest fix from the latest iso. The freedesktop theme is there but no other theme. I either need to add one or just let the user add one in the /usr/share/sounds. I am not sure about that. Question


Last edited by Upgreyed on 14th July 2024, 3:06 pm; edited 1 time in total
avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by davecs 14th July 2024, 10:14 am

Upgreyed wrote:
The xfce-sound-changer pkg install from synaptic will set the xfce-sound-changer config file and pull in the needed dependencies. No configuration should be required if someone has a xfce install without the latest fix from the latest iso. The freedesktop theme is there but no other theme. I either need to add one or just let the user add one in the /usr/share/sounds. I am not sure about that. Question

Can some of the sound themes be packaged? I've got Borealis, Enchanted, freedesktop, Fresh_and_Clean, Jam and Smooth here. Either individually or as "extra sounds" with one in the standard release? My recommendation for the standard release is don't make it Jam. That is only for people who like Heavy Metal and are not prone to headaches!! Very Happy Wink
Upgreyed
Upgreyed
Admin


Posts : 147
Join date : 2024-05-12
Location : The Sunshine State FL USA

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Upgreyed 14th July 2024, 10:20 am

davecs wrote:
Can some of the sound themes be packaged? I've got Borealis, Enchanted, freedesktop, Fresh_and_Clean, Jam and Smooth here. Either individually or as "extra sounds" with one in the standard release? My recommendation for the standard release is don't make it Jam. That is only for people who like Heavy Metal and are not prone to headaches!! Very Happy Wink
Sure, but I really need to add at least one in the pkg as a default one after thinking about it because freedesktop doesn't seem to work. If you can send or link those I will pkg some of them up as a separate add-on pkg.
avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by davecs 14th July 2024, 11:22 am

I've sent you a zip of the ones I have. Along with a couple of other suggestions!
Upgreyed
Upgreyed
Admin


Posts : 147
Join date : 2024-05-12
Location : The Sunshine State FL USA

SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Upgreyed 14th July 2024, 11:31 am

davecs wrote:I've sent you a zip of the ones I have. Along with a couple of other suggestions!
Added xfce-sound-extra_1.0.1-1pclos_all.deb

Description: This is a xfce extra system sounds package for the xfce desktop.
Package contains Borealis, Fresh_and_Clean, Jam, and Smooth sound themes.

Sponsored content


SOLVED: Can't turn on system sounds in XFCE Empty Re: SOLVED: Can't turn on system sounds in XFCE

Post by Sponsored content

  • Post new topic
  • Reply to topic

Current date/time is 21st November 2024, 5:57 am