background

This commit is contained in:
Yuvia 2025-08-11 12:43:34 +00:00
parent cb1db507db
commit a515c92369
2 changed files with 17 additions and 3 deletions

View file

@ -1,5 +1,5 @@
# rio
Rio is a rectangle multiplexer.
This rio has 1 spicy addition, though:
This rio has 2 spicy additions, though:
- different scrollbar reminiscent of the one found in _mux_.
:)
- reads background in from `$home/lib/riobg.bit`. if it is not present, background is 0x777777ff

16
data.c
View file

@ -187,7 +187,21 @@ Cursor *corners[9] = {
void
iconinit(void)
{
background = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x777777FF);
int fd;
char *buf, *h;
h = getenv("home");
if(h==nil)
sysfatal("please set your home: %r");
buf = smprint("%s/lib/riobg.bit", h);
fd = open(buf, OREAD);
if(fd<0)
background = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x777777FF);
else{
free(buf);
background = readimage(display, fd, 0);
close(fd);
}
/* greys are multiples of 0x11111100+0xFF, 14* being palest */
cols[BACK] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xFFFFFFFF^reverse);