diff options
| author | Cori Barker <coribarker2@gmail.com> | 2026-02-02 18:41:34 +0000 |
|---|---|---|
| committer | Cori Barker <coribarker2@gmail.com> | 2026-02-02 18:41:34 +0000 |
| commit | ec8ff8b83c9b306cc36ab04490c6c6c405b8321d (patch) | |
| tree | 0d372d6439d47e6104e3d5b8223a90b53596c839 /dwm/dwm.c | |
| parent | ebe221aa143ed7e7a75183f2560d099443d84feb (diff) | |
Patched in xlock with selected modes
Diffstat (limited to 'dwm/dwm.c')
| -rwxr-xr-x | dwm/dwm.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -26,6 +26,7 @@ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <time.h> #include <string.h> #include <unistd.h> #include <sys/types.h> @@ -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) { |
