diff --git a/st.c b/st.c index dd446cd..ccb9370 100644 --- a/st.c +++ b/st.c @@ -4034,6 +4034,17 @@ xresettitle(void) xsettitle(opt_title ? opt_title : "st"); } +void xcolor2title(void){ + char *cs; + size_t lencs; + + lencs = (size_t)snprintf(NULL,0,"new color %d",whichcolortable); + cs = malloc(lencs); + snprintf(cs,lencs,"new color %d",whichcolortable); + xsettitle(cs); + free(cs); +} + void redraw(void) { @@ -4176,6 +4187,7 @@ swapcolors(const Arg *dummy) if ( whichcolortable >= sizeof(colornames)/sizeof(colornames[0]) ) { whichcolortable = 0; } + xcolor2title(); xloadcols(); redraw(); }