sent

my build of simple presentation viewer
git clone git://git.kocotian.pl/sent.git
Log | Files | Refs | README | LICENSE

commit f09803dcb701321f04294b905300448ffab0687a
parent e64f6420eb7356f3cba87caeb844fbfa9a71f934
Author: kocotian <kocotian@kocotian.pl>
Date:   Wed, 27 Jan 2021 09:43:40 +0100

inverted colors

Diffstat:
Mconfig.def.h | 5+++++
Mpatches/sent-invertedcolors-72d33d4.diff | 0
Msent.1 | 3+++
Msent.c | 11++++++++++-
4 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/config.def.h b/config.def.h @@ -14,6 +14,11 @@ static const char *colors[] = { "#222222", /* foreground color */ }; +static const char *inverted_colors[] = { + "#222222", /* background color */ + "#ebdbb2", /* foreground color */ +}; + static const float linespacing = 1.4; /* how much screen estate is to be used at max for the content */ diff --git a/patches/sent-invertedcolors-72d33d4.diff b/patches/sent-invertedcolors-72d33d4.diff diff --git a/sent.1 b/sent.1 @@ -6,6 +6,7 @@ .Sh SYNOPSIS .Nm .Op Fl v +.Op Fl i .Op Ar file .Sh DESCRIPTION .Nm @@ -21,6 +22,8 @@ few minutes. .Bl -tag -width Ds .It Fl v Print version information to stdout and exit. +.It Fl i +Use the colors from the inverted color array. .El .Sh USAGE .Bl -tag -width Ds diff --git a/sent.c b/sent.c @@ -25,6 +25,8 @@ char *argv0; +int use_inverted_colors = 0; + /* macros */ #define LEN(a) (sizeof(a) / sizeof(a)[0]) #define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) @@ -635,7 +637,11 @@ xinit() if (!(d = drw_create(xw.dpy, xw.scr, xw.win, xw.w, xw.h))) die("sent: Unable to create drawing context"); - sc = drw_scm_create(d, colors, 2); + if (use_inverted_colors) { + sc = drw_scm_create(d, inverted_colors, 2); + } else { + sc = drw_scm_create(d, colors, 2); + } drw_setscheme(d, sc); XSetWindowBackground(xw.dpy, xw.win, sc[ColBg].pixel); @@ -736,6 +742,9 @@ main(int argc, char *argv[]) case 'v': fprintf(stderr, "sent-"VERSION"\n"); return 0; + case 'i': + use_inverted_colors = 1; + break; default: usage(); } ARGEND