From ec8ff8b83c9b306cc36ab04490c6c6c405b8321d Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Mon, 2 Feb 2026 18:41:34 +0000 Subject: Patched in xlock with selected modes --- dwm/dwm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'dwm/dwm.c') diff --git a/dwm/dwm.c b/dwm/dwm.c index 53b393e..ad5607f 100755 --- a/dwm/dwm.c +++ b/dwm/dwm.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -141,6 +142,7 @@ typedef struct { } Rule; /* function declarations */ +static void spawnlock(const Arg *arg); static void applyrules(Client *c); static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); static void arrange(Monitor *m); @@ -274,6 +276,20 @@ static Window root, wmcheckwin; struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; /* function implementations */ + +void +spawnlock(const Arg *arg) +{ + static char mode[32]; + size_t n = LENGTH(xlockmodes); + + srand(time(NULL) ^ getpid()); + snprintf(mode, sizeof mode, "%s", xlockmodes[rand() % n]); + + ((char **)lockcmd)[2] = mode; + spawn(&(Arg){ .v = lockcmd }); +} + void applyrules(Client *c) { -- cgit v1.2.3