[wiki] [sites] Revert "Patch to add individual colors to launcher icons" || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Mon, 25 Dec 2023 12:55:25 +0100

commit c685ccbe30427105733e79e99ebb35f433f54808
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon Dec 25 12:54:14 2023 +0100

    Revert "Patch to add individual colors to launcher icons"
    
    I guess this was a mistake? It references launcher colors which was added in a
    previous commit.
    
    If it's not a mistake feel free to fix it and fix the link to the patch.
    
    This reverts commit 0e391b50a6ae9a90128249eae31681afc6cfc4ac.

diff --git a/dwm.suckless.org/patches/keypressrelease/index.md b/dwm.suckless.org/patches/keypressrelease/index.md
index 73ed4f79..f3a1ee54 100644
--- a/dwm.suckless.org/patches/keypressrelease/index.md
+++ b/dwm.suckless.org/patches/keypressrelease/index.md
_AT_@ -1,142 +1,38 @@
-launcher-colors
-========
+keypressrelease
+===============
 
 Description
 -----------
-This patch adds colors to the launcher icons which you click to launch programs and commands.
+This patch lets you specify whether a key binding should be executed at the
+_KeyPress_ or _KeyRelease_ event. Executing on _KeyRelease_ fixes bugs such as
+`scrot -s` [failing to execute from a key binding](//lists.suckless.org/dev/1108/9185.html)
+due to keys not being released in time.
 
-Usage:
-------
-
-File config.def.h
-
-Append new color scheme to the colors array.
-Example below.
-
- static const char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { gray3, black, gray2 },
- [SchemeSel] = { gray4, blue, blue },
- [SchemeTitle] = { white, black, black }, // active window title
- [TabSel] = { blue, gray2, black },
- [TabNorm] = { gray3, black, black },
- [SchemeTag] = { gray3, black, black },
- [SchemeTag1] = { blue, black, black },
- [SchemeTag2] = { red, black, black },
- [SchemeTag3] = { orange, black, black },
- [SchemeTag4] = { green, black, black },
- [SchemeTag5] = { pink, black, black },
- [SchemeLayout] = { green, black, black },
- [SchemeBtnPrev] = { green, black, black },
- [SchemeBtnNext] = { yellow, black, black },
- [SchemeBtnClose] = { red, black, black },
- [SchemeColorEW] = { orange, black, black }, // color ewww launcher icon
- [SchemeColorFF] = { yellow, black, black }, // color firefox launcher icon
- [SchemeColorDS] = { red, black, black }, // color discord launcher icon
- [SchemeColorTG] = { green, black, black }, // color telegram launcher icon
- [SchemeColorMS] = { blue, black, black }, // color mintstick launcher icon
- [SchemeColorPC] = { pink, black, black }, // color pavucontrol launcher icon
- };
-
-The command names defined for the launchers are important since these are used again later.
-
- static const Launcher launchers[] = {
- /* command name to display */
- { eww, "" },
- { firefox, "" },
- { discord, "ﱲ" },
- { telegram, "" },
- { mintstick, "虜" },
- { pavucontrol, "墳" },
- };
-
-File dwm.c
-
-Append new color schemes to the enum.
-Example below.
-
- enum {
- SchemeNorm,
- SchemeSel,
- SchemeTitle,
- SchemeTag,
- SchemeTag1,
- SchemeTag2,
- SchemeTag3,
- SchemeTag4,
- SchemeTag5,
- SchemeLayout,
- TabSel,
- TabNorm,
- SchemeBtnPrev,
- SchemeBtnNext,
- SchemeBtnClose,
- SchemeColorEW,
- SchemeColorFF,
- SchemeColorDS,
- SchemeColorTG,
- SchemeColorMS,
- SchemeColorPC
- }; /* color schemes */
-
-File dwm.c
+Note that the new parameter must be added to all non-standard key bindings
+manually after patching.
 
-Navigate to the line where the following is defined:
+Usage
+-----
+A working `scrot -s` key binding:
 
- w = TEXTW(m->ltsymbol);
+ { KeyRelease, 0, XK_Print, spawn, SHCMD("scrot -s") },
 
-Comment out line
+Or to only display the bar while the toggle key is held down (requires that it
+is hidden to start with), add:
 
- drw_setscheme(drw, scheme[SchemeLayout]);
+ { KeyRelease, MODKEY, XK_b, togglebar, {0} },
 
-Inside the for loop add if conditions to set the different color schemes for each launcher.
+Alternatives
+------------
 
-Example below.
-Note. The command name should match the ones defined inside config.def.h
+An alternative is to put a tiny sleep right before executing scrot.
 
- w = TEXTW(m->ltsymbol);
- //drw_setscheme(drw, scheme[SchemeLayout]);
- x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
-
- for (i = 0; i < LENGTH(launchers); i++)
- {
- if (launchers[i].command == eww){
- drw_setscheme(drw, scheme[SchemeColorEW]);
- }
-
- if (launchers[i].command == firefox){
- drw_setscheme(drw, scheme[SchemeColorFF]);
- }
-
- if (launchers[i].command == discord){
- drw_setscheme(drw, scheme[SchemeColorDS]);
- }
-
- if (launchers[i].command == telegram){
- drw_setscheme(drw, scheme[SchemeColorTG]);
- }
-
- if (launchers[i].command == mintstick){
- drw_setscheme(drw, scheme[SchemeColorMS]);
- }
-
- if (launchers[i].command == pavucontrol){
- drw_setscheme(drw, scheme[SchemeColorPC]);
- }
-
- w = TEXTW(launchers[i].name);
-
-After a rebuild.
-
-The result will be as shown below.
-
-https://imgur.com/a/JsqUKiC
+ { ControlMask, XK_Print, spawn, SHCMD("sleep 0.2; scrot -s") },
 
 Download
 --------
-[dwm-launchers-colors-20231221-81aca1b.diff](dwm-launchers-colors-20231221-81aca1b.diff)
+* [dwm-keypressrelease-6.0.diff](dwm-keypressrelease-6.0.diff)
 
 Author
 ------
-* [fennec](https://debugthis.dev) - <xovo6six_AT_gmail.com>
-
+* Niklas Høj - `<niklas at hoej dot me>`
Received on Mon Dec 25 2023 - 12:55:25 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 25 2023 - 13:00:48 CET