[wiki] [sites] [sent] adds inverted colors patch || sirjofri

From: <git_AT_suckless.org>
Date: Sat, 29 Sep 2018 18:45:15 +0200

commit cbb38d912c41e6ea458fbb1a2c2a20e49e172ed6
Author: sirjofri <sirjofri_AT_sirjofri.de>
Date: Sat Sep 29 18:44:03 2018 +0200

    [sent] adds inverted colors patch

diff --git a/tools.suckless.org/sent/patches/inverted-colors/index.md b/tools.suckless.org/sent/patches/inverted-colors/index.md
new file mode 100644
index 00000000..4c59d47c
--- /dev/null
+++ b/tools.suckless.org/sent/patches/inverted-colors/index.md
_AT_@ -0,0 +1,26 @@
+Inverted Colors
+===============
+
+Description
+-----------
+
+This patch adds another color scheme. You can switch to that alternate color
+scheme with the `-i` flag. You no longer need to recompile sent if you want to
+present with a different color scheme.
+
+Notes
+-----
+
+Just with the original `colors` array (`config.h`) you can adjust the colors
+of the `inverted_colors` array. See `config.h` for more information.
+
+Download
+--------
+
+* [sent-invertedcolors-72d33d4.diff](sent-invertedcolors-72d33d4.diff)
+ (20190929)
+
+Author
+------
+
+* Joel F. Meyer (sirjofri) <sirjofri_AT_sirjofri.de>
diff --git a/tools.suckless.org/sent/patches/inverted-colors/sent-invertedcolors-72d33d4.diff b/tools.suckless.org/sent/patches/inverted-colors/sent-invertedcolors-72d33d4.diff
new file mode 100644
index 00000000..2da5fc5f
--- /dev/null
+++ b/tools.suckless.org/sent/patches/inverted-colors/sent-invertedcolors-72d33d4.diff
_AT_@ -0,0 +1,73 @@
+diff --git a/config.def.h b/config.def.h
+index 60eb376..ccea9a6 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -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
+_AT_@ -6,6 +6,7 @@
+ .Sh SYNOPSIS
+ .Nm
+ .Op Fl v
++.Op Fl i
+ .Op Ar file
+ .Sh DESCRIPTION
+ .Nm
+_AT_@ -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
+_AT_@ -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)
+_AT_@ -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);
+
+_AT_@ -687,6 +693,9 @@ main(int argc, char *argv[])
+ case 'v':
+ fprintf(stderr, "sent-"VERSION"
");
+ return 0;
++ case 'i':
++ use_inverted_colors = 1;
++ break;
+ default:
+ usage();
+ } ARGEND
Received on Sat Sep 29 2018 - 18:45:15 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 29 2018 - 18:48:29 CEST