summaryrefslogtreecommitdiff
path: root/patches/sent-invertedcolors-72d33d4.diff
blob: 2da5fc5f40144cdfbb765d75b128e35e0e222e78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/config.def.h b/config.def.h
index 60eb376..ccea9a6 100644
--- 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
index fabc614..f74d583 100644
--- 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
index c50a572..c31f772 100644
--- 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)
@@ -586,7 +588,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);
 
@@ -687,6 +693,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