commit c9368a7fce89675afe93757664da2e99adea1d23
parent 2649e8d5334f7e37a1710c60fb740ecfe91b9f9e
Author: afify <hassan@afify.dev>
Date: Thu, 15 Sep 2022 12:17:13 +0300
add invert patch
Diffstat:
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
@@ -13,6 +13,11 @@ static const char *colors[] = {
"#FFFFFF", /* background color */
};
+static const char *inverted_colors[] = {
+ "#FFFFFF", /* foreground color */
+ "#000000", /* background color */
+};
+
static const float linespacing = 1.4;
/* how much screen estate is to be used at max for the content */
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
@@ -20,6 +21,8 @@ few minutes.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl v
+.It Fl i
+Use the colors from the inverted color array.
Print version information to stdout and exit.
.El
.Sh USAGE
diff --git a/sent.c b/sent.c
@@ -24,6 +24,7 @@
#include "drw.h"
char *argv0;
+int use_inverted_colors = 0;
/* macros */
#define LEN(a) (sizeof(a) / sizeof(a)[0])
@@ -590,7 +591,12 @@ 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);
+ //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);
@@ -691,6 +697,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