mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-21 23:05:59 +01:00
Added OSC patch and changes xsetcolorname for live reloading pywal colors while keeping transparency
This commit is contained in:
parent
fdf3989005
commit
c6c7c8541d
4 changed files with 19 additions and 5 deletions
4
config.h
4
config.h
|
@ -143,8 +143,8 @@ static const char *colorname[] = {
|
|||
*/
|
||||
unsigned int defaultfg = 259;
|
||||
unsigned int defaultbg = 258;
|
||||
static unsigned int defaultcs = 256;
|
||||
static unsigned int defaultrcs = 257;
|
||||
unsigned int defaultcs = 256;
|
||||
unsigned int defaultrcs = 257;
|
||||
|
||||
/*
|
||||
* Default shape of cursor
|
||||
|
|
17
st.c
17
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 */
|
||||
|
|
1
st.h
1
st.h
|
@ -140,6 +140,7 @@ extern char *termname;
|
|||
extern unsigned int tabspaces;
|
||||
extern unsigned int defaultfg;
|
||||
extern unsigned int defaultbg;
|
||||
extern unsigned int defaultcs;
|
||||
extern const int boxdraw, boxdraw_bold, boxdraw_braille;
|
||||
extern float alpha;
|
||||
extern MouseKey mkeys[];
|
||||
|
|
2
x.c
2
x.c
|
@ -814,6 +814,8 @@ xsetcolorname(int x, const char *name)
|
|||
|
||||
XftColorFree(xw.dpy, xw.vis, xw.cmap, &dc.col[x]);
|
||||
dc.col[x] = ncolor;
|
||||
if (x == defaultbg)
|
||||
dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue