ability to change title (but no string to change yet)

This commit is contained in:
Howland Owl 2017-04-26 02:13:00 +03:00
parent bda5a8d1d2
commit 447600497e

12
st.c
View file

@ -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();
}