From e1a42edb2b515a6b322b37246f098a7c26958080 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Sun, 4 Jan 2026 21:57:53 +0100 Subject: [PATCH] Visual unlock - adding command line argument to help output and correcting typo ref. #14 --- patches.def.h | 6 +++--- slock.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/patches.def.h b/patches.def.h index 120fc90aa782bb9842a8a55f37c45a3193634b7f..89660bfdb786b5878cb22d237386c12bfdfcef09 100644 --- a/patches.def.h +++ b/patches.def.h @@ -139,9 +139,9 @@ */ #define UNLOCKSCREEN_PATCH 0 -/* This patch adds a command line argument -u that keeps the input locked but do not - * show the lock screen. The original patch simply combines the unlock screen patch and - * the DPMS patch. Enable DPMS_PATCH separately if you want DPMS. +/* This patch adds a -u command line argument that keeps input locked without showing the lock + * screen. The original patch simply combines the unlock screen patch and the DPMS patch. + * Enable DPMS_PATCH separately if you want DPMS. * https://tools.suckless.org/slock/patches/visual-unlock-dpms/ */ #define VISUAL_UNLOCK_PATCH 0 diff --git a/slock.c b/slock.c index e61e00072795ff83df9a75128731e8f5a8ff449e..c77e506f344d8f17d5ca68b44552dec2ca9f8ff4 100644 --- a/slock.c +++ b/slock.c @@ -637,11 +637,15 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen) static void usage(void) { - #if MESSAGE_PATCH || COLOR_MESSAGE_PATCH - die("usage: slock [-v] [-f] [-m message] [cmd [arg ...]]\n"); - #else - die("usage: slock [-v] [cmd [arg ...]]\n"); - #endif // MESSAGE_PATCH | COLOR_MESSAGE_PATCH + die("usage: slock [-v] " + #if VISUAL_UNLOCK_PATCH + "[-u] " + #endif + #if MESSAGE_PATCH || COLOR_MESSAGE_PATCH + "[-f] [-m message] " + #endif + "[cmd [arg ...]]\n" + ); } int