| tAdd audible bell - st - [fork] customized build of st, the simple terminal | |
| git clone git://src.adamsgaard.dk/st | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit bef599bb279e6c9b08853ceebefade066e362c48 | |
| parent 210dda9570095443bac887c2bfcd75f2bcc23780 | |
| Author: Roberto E. Vargas Caballero <[email protected]> | |
| Date: Thu, 12 Sep 2013 20:41:34 +0200 | |
| 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 <[email protected]> | |
| Diffstat: | |
| M config.def.h | 6 ++++++ | |
| M st.c | 2 ++ | |
| 2 files changed, 8 insertions(+), 0 deletions(-) | |
| --- | |
| diff --git a/config.def.h b/config.def.h | |
| t@@ -37,6 +37,12 @@ static unsigned int actionfps = 30; | |
| */ | |
| 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 */ | |
| static char termname[] = "st-256color"; | |
| diff --git a/st.c b/st.c | |
| t@@ -2320,6 +2320,8 @@ tputc(char *c, int len) { | |
| case '\a': /* BEL */ | |
| if(!(xw.state & WIN_FOCUSED)) | |
| xseturgency(1); | |
| + if (bellvolume) | |
| + XBell(xw.dpy, bellvolume); | |
| return; | |
| case '\033': /* ESC */ | |
| csireset(); |