sent

my sent build
git clone https://git.afify.dev/sent.git
Log | Files | Refs | README | LICENSE

commit 7e4550b91a510193e80ace2f4ebcdc1ba1f6d4b1
parent c9368a7fce89675afe93757664da2e99adea1d23
Author: afify <hassan@afify.dev>
Date:   Thu, 15 Sep 2022 12:32:47 +0300

toggle invert

Diffstat:
Mconfig.def.h | 1+
Msent.1 | 2++
Msent.c | 17+++++++++++++++++
3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -52,6 +52,7 @@ static Shortcut shortcuts[] = { { XK_n, advance, {.i = +1} }, { XK_p, advance, {.i = -1} }, { XK_r, reload, {0} }, + { XK_i, togglescm, {0} }, }; static Filter filters[] = { diff --git a/sent.1 b/sent.1 @@ -44,6 +44,8 @@ Reload the slides. Only works on file input. Go to next slide, if existent. .It Sy Left | Backspace | h | k | Up | Prior | p Go to previous slide, if existent. +.It Sy i +Toggle colorschemes. .El .El .Sh FORMAT diff --git a/sent.c b/sent.c @@ -106,6 +106,7 @@ static void xdraw(); static void xhints(); static void xinit(); static void xloadfonts(); +static void togglescm(); static void bpress(XEvent *); static void cmessage(XEvent *); @@ -614,6 +615,22 @@ xinit() } void +togglescm() +{ + if (use_inverted_colors) { + free(sc); + sc = drw_scm_create(d, colors, 2); + use_inverted_colors = 0; + } else { + sc = drw_scm_create(d, inverted_colors, 2); + use_inverted_colors = 1; + } + drw_setscheme(d, sc); + XSetWindowBackground(xw.dpy, xw.win, sc[ColBg].pixel); + xdraw(); +} + +void xloadfonts() { int i, j;