sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 0d932db493af0d566b817658f2930b7a934e3699
parent ec393a20aecd110a592a998a38b21313c8dfdce9
Author: Matthias Schoth <mschoth@gmail.com>
Date:   Tue,  9 Feb 2016 18:04:14 +0100

[st] Introducing visualbell patch

Diffstat:
Ast.suckless.org/patches/st-git-20160209-visualbell.diff | 42++++++++++++++++++++++++++++++++++++++++++
Ast.suckless.org/patches/visualbell.md | 24++++++++++++++++++++++++
2 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/st.suckless.org/patches/st-git-20160209-visualbell.diff b/st.suckless.org/patches/st-git-20160209-visualbell.diff @@ -0,0 +1,42 @@ +diff --git a/st.c b/st.c +index 0536b6f..948de40 100644 +--- a/st.c ++++ b/st.c +@@ -532,6 +532,7 @@ static char *opt_line = NULL; + static char *opt_name = NULL; + static char *opt_title = NULL; + static int oldbutton = 3; /* button event on startup: 3 = release */ ++static int bellon = 0; /* visual bell status */ + + static char *usedfont = NULL; + static double usedfontsize = 0; +@@ -2767,6 +2768,15 @@ tcontrolcode(uchar ascii) + xseturgency(1); + if (bellvolume) + XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL); ++ ++ /* visual bell*/ ++ if (!bellon) { ++ bellon = 1; ++ MODBIT(term.mode, !IS_SET(MODE_REVERSE), MODE_REVERSE); ++ redraw(); ++ XFlush(xw.dpy); ++ MODBIT(term.mode, !IS_SET(MODE_REVERSE), MODE_REVERSE); ++ } + } + break; + case '\033': /* ESC */ +@@ -4303,7 +4313,12 @@ run(void) + (handler[ev.type])(&ev); + } + +- draw(); ++ if (bellon) { ++ bellon = 0; ++ redraw(); ++ } ++ else draw(); ++ + XFlush(xw.dpy); + + if (xev && !FD_ISSET(xfd, &rfd)) diff --git a/st.suckless.org/patches/visualbell.md b/st.suckless.org/patches/visualbell.md @@ -0,0 +1,24 @@ +visualbell +========== + +Description +----------- + +Briefly inverts window content on terminal bell event. + +Notes +----- + +In order to be noticeable you might have to reduce the `xfps` +value in `config.h` to less than equal the refresh rate of your +monitor. + +Download +-------- + + * [st-git-20160209-visualbell.diff](st-git-20160209-visualbell.diff) + +Authors +------- + + * Matthias Schoth - mschoth@gmail.com