Add audible bell

\a is the character for bell, and st is only marking the window as urgent
if it is not active. This patch adds an audible bell which can be disable
with bellvolume variable.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
This commit is contained in:
Roberto E. Vargas Caballero authored and Christoph Lohmann committed 2013-09-12 20:47:41 +02:00
1 parent 210dda9570
commit bef599bb27
2 files changed
+8

No files matched your search

+6
View File
@@ -37,6 +37,12 @@ static unsigned int actionfps = 30;
*/ */
static unsigned int blinktimeout = 800; static unsigned int blinktimeout = 800;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 1;
/* TERM value */ /* TERM value */
static char termname[] = "st-256color"; static char termname[] = "st-256color";
+2
View File
@@ -2320,6 +2320,8 @@ tputc(char *c, int len) {
case '\a': /* BEL */ case '\a': /* BEL */
if(!(xw.state & WIN_FOCUSED)) if(!(xw.state & WIN_FOCUSED))
xseturgency(1); xseturgency(1);
if (bellvolume)
XBell(xw.dpy, bellvolume);
return; return;
case '\033': /* ESC */ case '\033': /* ESC */
csireset(); csireset();