LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to disable system bell in Debian 9 Stretch Xfce? (https://www.linuxquestions.org/questions/debian-26/how-to-disable-system-bell-in-debian-9-stretch-xfce-4175608842/)

linustalman 06-29-2017 08:31 AM

How to disable system bell in Debian 9 Stretch Xfce?
 
Hi.

How can I disable the system bell in Debian 9 Stretch Xfce?

It beeps if for example I'm in a text editor at the top of the page and push left arrow key. Or if I'm in Thunar and click the arrow but cannot move to another directory, etc.

This works but the sound returned on reboot:
Code:

xset b off
I tried this but no joy: https://blog.sleeplessbeastie.eu/201...e-system-bell/

I also tried this, no joy again: https://en.opensuse.org/SDB:Disabling_the_system_bell

Thanks.

IsaacKuo 06-29-2017 08:54 AM

Since you're using XFCE4, I would suggest creating a small shell script and adding it to the XFCE4 Sessions and Startup autostart. I'd make it look something like this:
Code:

#!/bin/sh
sleep 5
xset b off

If you don't know how to make a shell script, first use a text editor to create the file (call it mystartup.sh) and set it to executable with:
Code:

chmod 755 mystartup.sh
Then go into XFCE4's Session and Startup settings and add it to the Application Autostart tab.

Note that in this example it waits 5 seconds before running "xset b off". I find that adding a time delay helps ensure that XFCE4 has fully loaded up before we start messing with X settings. Otherwise, there's a decent chance of the script and XFCE4 stepping on each other's toes.

linustalman 06-29-2017 09:31 AM

Quote:

Originally Posted by IsaacKuo (Post 5728703)
Since you're using XFCE4, I would suggest creating a small shell script and adding it to the XFCE4 Sessions and Startup autostart. I'd make it look something like this:
Code:

#!/bin/sh
sleep 5
xset b off

If you don't know how to make a shell script, first use a text editor to create the file (call it mystartup.sh) and set it to executable with:
Code:

chmod 755 mystartup.sh
Then go into XFCE4's Session and Startup settings and add it to the Application Autostart tab.

Note that in this example it waits 5 seconds before running "xset b off". I find that adding a time delay helps ensure that XFCE4 has fully loaded up before we start messing with X settings. Otherwise, there's a decent chance of the script and XFCE4 stepping on each other's toes.


Hi Isaac.

The beep remains.

Would it make a difference if '#!/bin/bash' was used instead in the script? Edit: it doesn't.

This is very odd because if I manually put 'xset b off' into the terminal, the bell sound goes away. But in the script it never takes effect.

IsaacKuo 06-29-2017 10:10 AM

What happens if you run the script in a terminal window? Use:
Code:

./mystartup.sh
Does it complain with any error?

mralk3 06-29-2017 11:54 AM

How to disable system bell in Debian 9 Stretch Xfce?
 
Blacklist the "pcspkr" kernel module, rebuild the initramfs, then reboot. I haven't ran Debian in quite a while, but this used to be something I did on all my new installations.

linustalman 06-29-2017 01:01 PM

Quote:

Originally Posted by IsaacKuo (Post 5728748)
What happens if you run the script in a terminal window? Use:
Code:

./mystartup.sh
Does it complain with any error?

My mistake. When I copied the code from your post, sleep 5 and xset b off ended up on the same line. The script works perfectly. Thank you very much. :-)


All times are GMT -5. The time now is 08:05 PM.