[sf-lug] system beep

Grant Bowman grantbow at gmail.com
Fri Jan 8 13:43:34 PST 2010


On Fri, Jan 8, 2010 at 10:17 AM, Akkana Peck <akkana at shallowsky.com> wrote:
>> On Thu, 2010-01-07 at 17:49 -0800, Alex Kleider wrote:
>> > if at the linux command line (bash shell) I type
>> > $ echo $'\a'
>> > the bell rings
>
> jim writes:
>> when i use the command
>> $ echo $'\a'
>
> Another way is to tell bash to print the beep character (ctrl-G, ASCII 7):
> $ echo -e "\007"
>
> But when I put either one in a script and run it through at, the
> problem seems to be that at is redirecting the output, so the ctrl-G
> never goes to a terminal that can turn it into sound. Try adding
> some visible text in your script:
>
> echo BEEP $'\a'
>
> and you'll see that you never see the BEEP either if you call it
> from at.
>
> If you explicitly redirect it to a terminal, it works.
> For instance, type tty to find out what your current terminal is,
> then put that in the script:
>
> echo BEEP $'\a' >/dev/pts/1
>
> and call it from at, and it should work (it did for me).
>
> But that's not very convenient if you want to schedule a script to run
> days fom now, since you'd have to be sure what pty is there that
> you can write to.
>
> If your script can run as root, you could use the console:
>
> echo $'\a' >/dev/console
>
> Or if you're pretty sure you'll be logged in on the console as
> your own user, you could use tty0 or tty1:
>
> echo $'\a' >/dev/tty1

One would think something as simple as a good old beep would be pretty
standard now, redirected to something nicer sounding.  I don't know
what other distros have done but Ubuntu has made some changes lately.
Several issues have cropped up around how this is implemented in
Ubuntu.  There were some problems with very loud system beeps in part
due to a kernel change and in part due to other sound configurations.
Alsa mixer muted my beep on my fresh Karmic install on my laptop.  I
wanted the regular gnome-terminal beep back as described in the second
link.  Sounds like your mileage may vary.

https://bugs.launchpad.net/ubuntu/karmic/+source/linux/+bug/77010

http://friendlytechninja.com/2009/10/16/howto-fix-alert-system-beep-in-ubuntu-9-10-karmic-koala/

Grant




More information about the sf-lug mailing list