Difference between revisions of "Beep"

From ArchWiki
Jump to: navigation, search
m (the last edit is a little too scary)
(simplification and beautification of wikilinks, fixing whitespace, capitalization and section fragments (https://github.com/lahwaacz/wiki-scripts/blob/master/link-checker.py (interactive)))
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Audio/Video]]
+
[[Category:Sound]]
{{stub}}
+
{{Merge|Disable PC speaker beep|...and rename to [[PC speaker]]?}}
  
 
Beep is an advanced PC speaker beeping program. It is useful for situations where no sound card and/or speakers are available, and simple audio notification is desired.
 
Beep is an advanced PC speaker beeping program. It is useful for situations where no sound card and/or speakers are available, and simple audio notification is desired.
  
 
==Installation==
 
==Installation==
Command-line interface to this feature can be installed with Pacman.
+
[[Install]] the {{Pkg|beep}} package.
# pacman -S beep
+
  
 
==Configuration==
 
==Configuration==
By default, only root can run the beep command, but other users can be allowed to run it by changing the permissions of the beep command.
+
=== Access for non-root users ===
 +
 
 +
By default {{ic|beep}} will fail if not run by the root. Other users may call it using [[sudo]]. To let group {{ic|users}} call {{ic|sudo beep}} without a password (for example to use it in scripts), {{ic|/etc/sudoers}} [[Sudo#Using_visudo|should be edited]]:
 +
 
 +
%users ALL=(ALL) NOPASSWD: /usr/bin/beep
 +
 
 +
or, to let only a single user do that:
 +
 
 +
username ALL=(ALL) NOPASSWD: /usr/bin/beep
 +
 
 +
Another way is setting the sticky bit on {{ic|/usr/bin/beep}}:
  
 
  # chmod 4755 /usr/bin/beep
 
  # chmod 4755 /usr/bin/beep
 +
 +
Note however that this way '''anyone''' can execute {{ic|/usr/bin/beep}} with root permissions. The change also creates a difference between local copy and the package, which will be reported by {{ic|pacman -Qkk}}.
 +
 +
===Unmuting in alsamixer===
  
 
You should also unmute the Beep channel using {{Ic|alsamixer}}.
 
You should also unmute the Beep channel using {{Ic|alsamixer}}.
Line 17: Line 30:
 
  $ alsamixer
 
  $ alsamixer
  
you may need to press {{keypress|F6}} and select your card. scroll to the Beep channel using the arrow keys and press {{keypress|M}} to unmute the channel. notice that the "MM" label below the channel will change to "00". you can also use {{keypress|↑}} to increase the volume of the channel.
+
You may need to press {{ic|F6}} and select your card. scroll to the Beep channel using the arrow keys and press {{ic|M}} to unmute the channel. notice that the "MM" label below the channel will change to "00". you can also use {{ic|↑}} to increase the volume of the channel.
  
press {{Keypress|Esc}} to close alsamixer.
+
Press {{ic|Esc}} to close alsamixer.
  
you can also save your settings to ALSA Mixer to make it permanent:
+
You can also save your settings to ALSA Mixer to make it permanent:
  
 
  # alsactl -f /var/lib/alsa/asound.state store
 
  # alsactl -f /var/lib/alsa/asound.state store

Latest revision as of 11:12, 27 February 2016

Merge-arrows-2.pngThis article or section is a candidate for merging with Disable PC speaker beep.Merge-arrows-2.png

Notes: ...and rename to PC speaker? (Discuss in Talk:Beep#)

Beep is an advanced PC speaker beeping program. It is useful for situations where no sound card and/or speakers are available, and simple audio notification is desired.

Installation

Install the beep package.

Configuration

Access for non-root users

By default beep will fail if not run by the root. Other users may call it using sudo. To let group users call sudo beep without a password (for example to use it in scripts), /etc/sudoers should be edited:

%users ALL=(ALL) NOPASSWD: /usr/bin/beep

or, to let only a single user do that:

username ALL=(ALL) NOPASSWD: /usr/bin/beep

Another way is setting the sticky bit on /usr/bin/beep:

# chmod 4755 /usr/bin/beep

Note however that this way anyone can execute /usr/bin/beep with root permissions. The change also creates a difference between local copy and the package, which will be reported by pacman -Qkk.

Unmuting in alsamixer

You should also unmute the Beep channel using alsamixer.

$ alsamixer

You may need to press F6 and select your card. scroll to the Beep channel using the arrow keys and press M to unmute the channel. notice that the "MM" label below the channel will change to "00". you can also use to increase the volume of the channel.

Press Esc to close alsamixer.

You can also save your settings to ALSA Mixer to make it permanent:

# alsactl -f /var/lib/alsa/asound.state store

Tips and Tricks

While many people are happy with the traditional beep sound, some may like to change its properties a bit. The following example plays slighly higher and shorter sound and repeats it two times.

# beep -f 5000 -l 50 -r 2

See also