Prev | Current Page 166 | Next

Chris Tyler

"X Power Tools"


Your desktop, therefore, might have a 15 cent speaker in the system unit under the
desk, packed full of dust and competing with multiple system fans to be heard.
There??™s no way to really control the bell volume, because the PC??™s speaker circuit
simply clocks out a 5-volt square wave of adjustable frequency.
To set the bell, use the b subcommand provided by xset:
$ xset b volume pitch duration
Where volume is the volume level from 0??“100%, pitch is in Hertz, and duration is in
milliseconds. The X.org server will actually shorten the duration based on the volume
setting, in a feeble attempt to make up for the lack of hardware volume control.
The default bell settings in the X.org server are 50% volume, 400 Hz, and 100 ms,
which are reasonable for most purposes. If you can??™t hear the bell, try 100%, 1,200
Hz, and 100 ms:
$ xset b 100 1200 100
If you don??™t like the result, just experiment; given the cheap speaker, you??™ll probably
want to stay in the 100 Hz??“14,000 Hz range.
6.6
102 Chapter 6: X Utility Programs
You can leave out any of the numeric arguments to xset b starting at the end; if you
leave them all out, the settings reset to the defaults. To turn off the bell entirely, use
the following:
$ xset b off
The X bell mechanism provides a trivial way to give audio feedback in a script; this
can be useful for various quick-and-dirty applications.


Pages:
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
Hotel Berlino Porównywarka agencja reklamowa poznań Athlete parasole reklamowe