summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-10-29 15:17:24 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2020-10-29 15:17:24 -0400
commite95599ddf5a2745ddc36f701483f39e0e6aacfbf (patch)
tree7fea7f4500a94855f58481c59e3357ba90999338 /patches
parent2649e8d5334f7e37a1710c60fb740ecfe91b9f9e (diff)
Initial CommitHEADmaster
Diffstat (limited to 'patches')
-rw-r--r--patches/sent-invertedcolors-72d33d4.diff73
-rw-r--r--patches/sent-options-20190213-72d33d4.diff72
-rw-r--r--patches/sent-progress-bar-1.0.diff31
3 files changed, 176 insertions, 0 deletions
diff --git a/patches/sent-invertedcolors-72d33d4.diff b/patches/sent-invertedcolors-72d33d4.diff
new file mode 100644
index 0000000..2da5fc5
--- /dev/null
+++ b/patches/sent-invertedcolors-72d33d4.diff
@@ -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
+@@ -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
diff --git a/patches/sent-options-20190213-72d33d4.diff b/patches/sent-options-20190213-72d33d4.diff
new file mode 100644
index 0000000..d13df48
--- /dev/null
+++ b/patches/sent-options-20190213-72d33d4.diff
@@ -0,0 +1,72 @@
+From 3a348cc15a97df8e8784b129800293dcfba28f3f Mon Sep 17 00:00:00 2001
+From: Sunur Efe Vural <efe@efe.kim>
+Date: Wed, 13 Feb 2019 14:28:17 -0500
+Subject: [PATCH] Commandline Options
+
+A simple patch that adds extra commandline options to sent.
+---
+ sent.1 | 11 +++++++++++
+ sent.c | 11 ++++++++++-
+ 2 files changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/sent.1 b/sent.1
+index fabc614..5d55bf4 100644
+--- a/sent.1
++++ b/sent.1
+@@ -5,6 +5,9 @@
+ .Nd simple plaintext presentation tool
+ .Sh SYNOPSIS
+ .Nm
++.Op Fl f Ar font
++.Op Fl c Ar fgcolor
++.Op Fl b Ar bgcolor
+ .Op Fl v
+ .Op Ar file
+ .Sh DESCRIPTION
+@@ -21,6 +24,14 @@ few minutes.
+ .Bl -tag -width Ds
+ .It Fl v
+ Print version information to stdout and exit.
++.It Fl f Ar font
++Defines the
++.Ar font
++when sent is run.
++.It Fl c Ar fgcolor
++Defines the foreground color when sent is run.
++.It Fl b Ar bgcolor
++Defines the background color when sent is run.
+ .El
+ .Sh USAGE
+ .Bl -tag -width Ds
+diff --git a/sent.c b/sent.c
+index c50a572..0b36e32 100644
+--- a/sent.c
++++ b/sent.c
+@@ -675,7 +675,7 @@ configure(XEvent *e)
+ void
+ usage()
+ {
+- die("usage: %s [file]", argv0);
++ die("usage: %s [-c fgcolor] [-b bgcolor] [-f font] [file]", argv0);
+ }
+
+ int
+@@ -687,6 +687,15 @@ main(int argc, char *argv[])
+ case 'v':
+ fprintf(stderr, "sent-"VERSION"\n");
+ return 0;
++ case 'f':
++ fontfallbacks[0] = EARGF(usage());
++ break;
++ case 'c':
++ colors[0] = EARGF(usage());
++ break;
++ case 'b':
++ colors[1] = EARGF(usage());
++ break;
+ default:
+ usage();
+ } ARGEND
+--
+2.20.1
+
diff --git a/patches/sent-progress-bar-1.0.diff b/patches/sent-progress-bar-1.0.diff
new file mode 100644
index 0000000..9d0e7d2
--- /dev/null
+++ b/patches/sent-progress-bar-1.0.diff
@@ -0,0 +1,31 @@
+diff --git a/config.def.h b/config.def.h
+index 60eb376..25d89e0 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -19,6 +19,9 @@ static const float linespacing = 1.4;
+ static const float usablewidth = 0.75;
+ static const float usableheight = 0.75;
+
++/* height of the presentation progress bar */
++static const int progressheight = 5;
++
+ static Mousekey mshortcuts[] = {
+ /* button function argument */
+ { Button1, advance, {.i = +1} },
+diff --git a/sent.c b/sent.c
+index c50a572..046466e 100644
+--- a/sent.c
++++ b/sent.c
+@@ -533,6 +533,12 @@ xdraw()
+ 0,
+ slides[idx].lines[i],
+ 0);
++ if (idx != 0 && progressheight != 0) {
++ drw_rect(d,
++ 0, xw.h - progressheight,
++ (xw.w * idx)/(slidecount - 1), progressheight,
++ 1, 0);
++ }
+ drw_map(d, xw.win, 0, 0, xw.w, xw.h);
+ } else {
+ if (!(im->state & SCALED))