# xset question



## mdg (Nov 27, 2010)

I have been using xset to turn off the bell/beep on my Presario 700Z laptop.
Have been typing in the command 
	
	



```
xset b off
```
 at the terminal to
accomplish this.  My question is how to automate this.  I thought I simply
needed to include the code in my .xinitrc file (I use startx to get X going).
But that does not turn off the beep.

I use fluxbox as my wm and the fluxbox startup script to start X.  My .xinitrc
is simply this

```
#!/bin/sh
xset b off
exec startfluxbox
```
This does not work.
I also tried using xset in the fluxbox startup script.
This does not work.  My question is what is the proper way to turn off the beep
on my terminal when runing Xorg?  More generally, how do you automate xset commands?

Thanks for any help.
Mike


----------



## jrm@ (Nov 28, 2010)

I think I remember reading that this problem results from timing issues, i.e., the xset is called before the X server is running.

Some options to look in to:

Put 

*hw.syscons.bell=0* in /etc/sysctl.conf
*set bell-style none* in ~/.inputrc
**visualBell: True* in ~/.Xdefaults.

jrm


----------



## fronclynne (Nov 29, 2010)

If it is a timing issue, you could also place a sleep(1) in your script.


----------



## mdg (Nov 30, 2010)

Would I simply do

```
#!/bin/sh
sleep 5
xset b off
exec startfluxbox
```
in my xinitrc file?  Just tried that and it does not work.

When I check around the web, it is being said that there is a bug
in the current version of Xorg that prevents xset from working in
xinitrc.  Anyone know details about this?

Mike


----------



## expl (Nov 30, 2010)

You need to finish every command with a & except  the last one, that should be execution of your wimdow mamager.  X will terminate on the exit of first command that was not sent to the background.


----------



## fronclynne (Dec 1, 2010)

expl said:
			
		

> You need to finish every command with a & except  the last one, that should be execution of your wimdow mamager.  X will terminate on the exit of first command that was not sent to the background.



That isn't a hard rule, AFIK.  Programs that exit immediately (xset being an obvious candidate) will leave your process list littered with zombie sh(1)es.  Not harmful, but annoying.

What I've done in the dim & distant past is to create an executable script named ~/.xsession like 
	
	



```
#!/bin/sh
 setxkbmap -option compose:caps
 xsetroot -cursor_name ul_angle -solid grey23
 xset b 10 150 10
```
and call it from ~/.xinitrc.

I dunno though, I don't really pay attention until something breaks badly, so it might not be doing anything any more.


----------

