From 23328b92ba2430d5d97ab025fe9dcab272ef2d2b Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Sat, 12 Aug 2023 17:56:53 +0000 Subject: [PATCH 1/2] Support per-output -gradient --- hsetroot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hsetroot.c b/hsetroot.c index 90ce65e..181a37e 100644 --- a/hsetroot.c +++ b/hsetroot.c @@ -398,7 +398,10 @@ main(int argc, char **argv) fprintf (stderr, "Bad angle (%s)\n", argv[i]); continue; } - imlib_image_fill_color_range_rectangle(0, 0, width, height, angle); + for (int j = 0 ; j < noutputs; j++) { + XineramaScreenInfo o = outputs[j]; + imlib_image_fill_color_range_rectangle(o.x_org, o.y_org, o.width, o.height, angle); + } } else if (strcmp(argv[i], "-fill") == 0) { if ((++i) >= argc) { fprintf(stderr, "Missing image\n"); From 08bfa678dc308b244053eeeb90edbde795a09ee2 Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Wed, 17 Dec 2025 20:02:15 +0000 Subject: [PATCH 2/2] make -gradient accept floats Closes #45 Thanks to lindhobe --- hsetroot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hsetroot.c b/hsetroot.c index 181a37e..e44b743 100644 --- a/hsetroot.c +++ b/hsetroot.c @@ -389,12 +389,12 @@ main(int argc, char **argv) imlib_context_set_color(c.r, c.g, c.b, c.a); imlib_add_color_to_color_range(distance); } else if (strcmp(argv[i], "-gradient") == 0) { - int angle; + double angle; if ((++i) >= argc) { fprintf(stderr, "Missing angle\n"); continue; } - if (sscanf(argv[i], "%i", &angle) == 0) { + if (sscanf(argv[i], "%lf", &angle) == 0) { fprintf (stderr, "Bad angle (%s)\n", argv[i]); continue; }