commit 185aca71336699e0c580458b444e4c3653ddf449
parent bf2c85aa117c26a20d3282acdfe268cdd91c0a21
Author: Milutin Popovic <mika@popovic.xyz>
Date: Tue, 18 Nov 2025 22:26:24 +0000
draw on both monitors specific setup
Diffstat:
4 files changed, 60 insertions(+), 13 deletions(-)
diff --git a/config.h b/config.h
@@ -11,15 +11,19 @@ static const char *colorname[NUMCOLS] = {
};
/* treat a cleared input like a wrong password (color) */
-static const int failonclear = 1;
+static int failonclear = 1;
-static const int monitortime = 600;
+static int monitortime = 600;
-static const int logosize = 50;
-static const int logow = 9; /* Grid width and height for right center alignment*/
-static const int logoh = 6;
+static int logosize = 50;
+static int logow = 9; /* Grid width and height for right center alignment*/
+static int logoh = 6;
-static XRectangle rectangles[9] = {
+/* Setup specific draw on two monitors should be 0 false or 1 true */
+
+static int draw_on_two= 1;
+
+static XRectangle rectangles_double[18] = {
/* x y w h */
{ 0, 4, 1, 2 },
{ 1, 2, 1, 2 },
@@ -28,25 +32,59 @@ static XRectangle rectangles[9] = {
{ 4, 0, 3, 1 },
{ 4, 5, 3, 1 },
{ 6, 0, 1, 6 },
+ //
+ { -40, 4, 1, 2 },
+ { -39, 2, 1, 2 },
+ { -38, 0, 1, 2 },
+ { -36, 0, 1, 6 },
+ { -36, 0, 3, 1 },
+ { -36, 5, 3, 1 },
+ { -34, 0, 1, 6 },
+};
+
+static XRectangle rectangles[18] = {
+ /* x y w h */
+ { 0, 4, 1, 2 },
+ { 1, 2, 1, 2 },
+ { 2, 0, 1, 2 },
+ { 4, 0, 1, 6 },
+ { 4, 0, 3, 1 },
+ { 4, 5, 3, 1 },
+ { 6, 0, 1, 6 },
+ { 0, 4, 1, 2 },
+ { 1, 2, 1, 2 },
+ { 2, 0, 1, 2 },
+ { 4, 0, 1, 6 },
+ { 4, 0, 3, 1 },
+ { 4, 5, 3, 1 },
+ { 6, 0, 1, 6 },
};
/*Enable blur*/
#define BLUR
/*Set blur radius*/
-static const int blurRadius=10;
+static int blurRadius=10;
/*Enable Pixelation*/
#define PIXELATION
/*Set pixelation radius*/
-static const int pixelSize=10;
+static int pixelSize=10;
/*
* Xresources preferences to load at startup
*/
ResourcePref resources[] = {
- { "color_background", STRING, &colorname[BACKGROUND] },
- { "color_init", STRING, &colorname[INIT] },
- { "color_input", STRING, &colorname[INPUT] },
- { "color_failed", STRING, &colorname[FAILED] },
- { "color_caps", STRING, &colorname[CAPS] },
+ { "color_background", STRING, &colorname[BACKGROUND] },
+ { "color_init", STRING, &colorname[INIT] },
+ { "color_input", STRING, &colorname[INPUT] },
+ { "color_failed", STRING, &colorname[FAILED] },
+ { "color_caps", STRING, &colorname[CAPS] },
+ { "failonclear", INTEGER, &failonclear },
+ { "monitortime", INTEGER, &monitortime },
+ { "logosize", INTEGER, &logosize },
+ { "logow", INTEGER, &logow },
+ { "logoh", INTEGER, &logoh },
+ { "draw_on_two", INTEGER, &draw_on_two },
+ { "blurRadius", INTEGER, &blurRadius },
+ { "pixelSize", INTEGER, &pixelSize },
};
diff --git a/slock b/slock
Binary files differ.
diff --git a/slock.c b/slock.c
@@ -164,6 +164,15 @@ resizerectangles(struct lock *lock)
{
int i;
+ if (draw_on_two == 1) {
+ memcpy(
+ rectangles,
+ rectangles_double,
+ sizeof(XRectangle)*LENGTH(rectangles)
+ );
+ }
+
+
for (i = 0; i < LENGTH(rectangles); i++){
lock->rectangles[i].x = (rectangles[i].x * logosize)
+ lock->xoff + ((lock->mw) / 2) - (logow / 2 * logosize);
diff --git a/slock.o b/slock.o
Binary files differ.