summaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorTristan Simas <tristan.simas@mail.mcgill.ca>2020-05-13 14:52:22 -0400
committerTristan Simas <tristan.simas@mail.mcgill.ca>2020-05-13 14:52:22 -0400
commitc6c7c8541dde87b87d492465a1af3c585e5e19a0 (patch)
treec1357f580ca9be82571f3508a649d7655abeb1fe /st.c
parentfdf3989005a9003b90a3e98d4ba5684d52f11d3c (diff)
Added OSC patch and changes xsetcolorname for live reloading pywal colors while keeping transparency
Diffstat (limited to 'st.c')
-rw-r--r--st.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/st.c b/st.c
index 192360b..618e11b 100644
--- a/st.c
+++ b/st.c
@@ -1943,12 +1943,23 @@ strhandle(void)
}
return;
case 4: /* color set */
- if (narg < 3)
+ case 10: /* foreground set */
+ case 11: /* background set */
+ case 12: /* cursor color */
+ if ((par == 4 && narg < 3) || narg < 2)
break;
- p = strescseq.args[2];
+ p = strescseq.args[((par == 4) ? 2 : 1)];
/* FALLTHROUGH */
case 104: /* color reset, here p = NULL */
- j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
+ if (par == 10)
+ j = defaultfg;
+ else if (par == 11)
+ j = defaultbg;
+ else if (par == 12)
+ j = defaultcs;
+ else
+ j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
+
if (xsetcolorname(j, p)) {
if (par == 104 && narg <= 1)
return; /* color reset without parameter */