[wiki] [sites] [st][patch][selectioncolors] Add patch || aleks

From: <git_AT_suckless.org>
Date: Thu, 10 Oct 2019 13:05:18 +0200

commit 15fbdd2ad390078d18eea937a17c3fe6df2effed
Author: aleks <aleks.stier_AT_icloud.com>
Date: Thu Oct 10 13:04:29 2019 +0200

    [st][patch][selectioncolors] Add patch

diff --git a/st.suckless.org/patches/selectioncolors/index.md b/st.suckless.org/patches/selectioncolors/index.md
new file mode 100644
index 00000000..d4810a3b
--- /dev/null
+++ b/st.suckless.org/patches/selectioncolors/index.md
_AT_@ -0,0 +1,18 @@
+selectioncolors
+===============
+
+Description
+-----------
+
+This patch adds the two settings *selectionfg* and *selectionbg* to
+config.def.h. Those define the fore- and background colors which are
+used when text on the screen is selected with the mouse.
+This removes the default behaviour which would simply reverse the colors.
+
+Download
+--------
+* [st-selectioncolors-0.8.2.diff](st-selectioncolors-0.8.2.diff)
+
+Authors
+-------
+* Aleksandrs Stier
diff --git a/st.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.2.diff b/st.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.2.diff
new file mode 100644
index 00000000..7023f5fb
--- /dev/null
+++ b/st.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.2.diff
_AT_@ -0,0 +1,50 @@
+From fdbe8cc09d765a1b257aadf0d05ee2cf453d5ffc Mon Sep 17 00:00:00 2001
+From: aleks <aleks.stier_AT_icloud.com>
+Date: Thu, 10 Oct 2019 12:11:11 +0200
+Subject: [PATCH] Add settings for selection-colors
+
+This patch adds the two settings selectionfg and selectionbg to
+config.def.h. Those define the fore- and background colors which are
+used when text on the screen is selected with the mouse.
+
+This removes the default behaviour which would simply reverse the colors
+of each selected cell.
+---
+ config.def.h | 4 ++++
+ x.c | 5 ++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 0e01717..654b1c7 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -121,6 +121,10 @@ unsigned int defaultbg = 0;
+ static unsigned int defaultcs = 256;
+ static unsigned int defaultrcs = 257;
+
++/* Colors used for selection */
++unsigned int selectionfg = 7;
++unsigned int selectionbg = 8;
++
+ /*
+ * Default shape of cursor
+ * 2: Block ("█")
+diff --git a/x.c b/x.c
+index 0422421..310b99c 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -1336,9 +1336,8 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
+ }
+
+ if (base.mode & ATTR_REVERSE) {
+- temp = fg;
+- fg = bg;
+- bg = temp;
++ fg = &dc.col[selectionfg];
++ bg = &dc.col[selectionbg];
+ }
+
+ if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK)
+--
+2.23.0
+
Received on Thu Oct 10 2019 - 13:05:18 CEST

This archive was generated by hypermail 2.3.0 : Thu Oct 10 2019 - 13:12:35 CEST