Search code examples
commandopensusebeep

OpenSuse - Command for Beep Sound (System Bell)


I have a source code that runs perfectly fine on Ubuntu, it does some copumtations, and at some points it beeps like this

system("beep -f 400 -l 500");

On Ubuntu I had to do

apt-get install beep

However, I migrated to OpenSuse (not my choice) and now I get this message "sh: beep: command not found", as the command and package are obviously different.

Does anybody know hot to trigger the system beep sound and define the duration and frequency? I have been able to find only one way to change the parameters

setterm -bfreq 500 -blength 500

, but no way to actually trigger the system bell (beep). The following things don't work

echo ^G
echo -e "\a"

PS - the system Bell is enabled at Configure Desktop -> Application and System Notifications -> System Bell and you can actually play with this


Solution

  • So, I did what @fvu proposed.

    However, one needs to have sudo rights, to do so, otherwise (e.g. at my work-place we don't have sudo rights) there is this output message

    Could not open /dev/tty0 or /dev/vc/0 for writing open: No such file or directory

    In this case, you should:

    sudo chmod 4755 /usr/bin/beep

    as proposed here