sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 15fbdd2ad390078d18eea937a17c3fe6df2effed
parent a2fc6bfdaf79be716dc9e43befaad1886e167f5d
Author: aleks <aleks.stier@icloud.com>
Date:   Thu, 10 Oct 2019 13:04:29 +0200

[st][patch][selectioncolors] Add patch

Diffstat:
Ast.suckless.org/patches/selectioncolors/index.md | 18++++++++++++++++++
Ast.suckless.org/patches/selectioncolors/st-selectioncolors-0.8.2.diff | 50++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/st.suckless.org/patches/selectioncolors/index.md b/st.suckless.org/patches/selectioncolors/index.md @@ -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 @@ -0,0 +1,50 @@ +From fdbe8cc09d765a1b257aadf0d05ee2cf453d5ffc Mon Sep 17 00:00:00 2001 +From: aleks <aleks.stier@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 +@@ -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 +@@ -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 +