From a7b3cb469a3e087965e7469b09e6a6774e23fd8d Mon Sep 17 00:00:00 2001 From: speedie Date: Thu, 22 Dec 2022 19:07:15 +0100 Subject: [PATCH] add ability to disable reloading colors sequences --- keybinds.h | 3 --- st.c | 7 +++++-- toggle.h | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/keybinds.h b/keybinds.h index 1ab05c9..b3e4ac6 100644 --- a/keybinds.h +++ b/keybinds.h @@ -25,9 +25,6 @@ static Shortcut shortcuts[] = { { CONTROL, XK_Escape, keyboardselect, {.i = 0} }, { CONTROL|SHIFT, XK_H, kexec, {.scmd = ";st_help" } }, { CONTROL|SHIFT, XK_D, kexec, {.scmd = ";$PERM !!" } }, - { CONTROL|SHIFT, XK_F, kexec, {.scmd = ";$EDITOR $(find $HOME/.config -type f | fzf)" } }, - { CONTROL|SHIFT, XK_S, kexec, {.scmd = ";$EDITOR $(find $HOME/Scripts -type f | fzf)" } }, - { CONTROL|SHIFT, XK_W, kexec, {.scmd = ";$PERM make clean install" } }, { CONTROL|SHIFT, XK_K, kscrollup, {.i = -1} }, { CONTROL|SHIFT, XK_J, kscrolldown, {.i = -1} }, { CONTROL|SHIFT, XK_U, externalpipeout,{.v = listurl } }, diff --git a/st.c b/st.c index 5d599e8..90f6b45 100644 --- a/st.c +++ b/st.c @@ -22,6 +22,7 @@ #include "sixel.h" #include "st.h" #include "win.h" +#include "toggle.h" #if defined(__linux) #include @@ -2214,6 +2215,7 @@ strhandle(void) char *p = NULL, *dec; int j, narg, par; int i; + int reloadcolors; const struct { int idx; char *str; } osc_table[] = { { defaultfg, "foreground" }, { defaultbg, "background" }, @@ -2270,11 +2272,12 @@ strhandle(void) tfulldirt(); } return; - case 4: /* color set */ + #if RELOADCOLORS + case 4: if (narg < 3) break; p = strescseq.args[2]; - /* FALLTHROUGH */ + #endif case 104: /* color reset */ j = (narg > 1) ? atoi(strescseq.args[1]) : -1; diff --git a/toggle.h b/toggle.h index c556c3d..f0e56e3 100644 --- a/toggle.h +++ b/toggle.h @@ -1,3 +1,5 @@ /* Toggle features */ - #define USEXRESOURCES 1 /* Include Xresources support (0/1) */ + +/* Toggle functionality */ +#define RELOADCOLORS 0 /* Allow programs like pywal to reload colors during runtime through sequences (0/1) */