diff options
author | Luke Smith <luke@lukesmith.xyz> | 2020-05-13 18:10:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-13 18:10:29 -0400 |
commit | 74b68b32fab4d039b43cf5631c0617fcde1e9bbf (patch) | |
tree | bc63d35b5f4904310c76695f8334a6c5400d83cb /st.c | |
parent | fdf3989005a9003b90a3e98d4ba5684d52f11d3c (diff) | |
parent | 05708c89c3aec1615f03171d205fd0d2573f635c (diff) |
Merge pull request #208 from trissim/wal-osc
Pywal live reload with OSC patch and transparency fix
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -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 */ @@ -1959,6 +1970,8 @@ strhandle(void) * TODO if defaultbg color is changed, borders * are dirty */ + if (j == defaultbg) + xclearwin(); redraw(); } return; |