From ca593ce987c15f96a6f3933beb8b031d6744b91b Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 5 Aug 2014 19:20:22 -0700 Subject: [PATCH] use -f .slock_passwd by default. --- slock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/slock.c b/slock.c index 1cf58e0..abcbc25 100644 --- a/slock.c +++ b/slock.c @@ -338,7 +338,11 @@ main(int argc, char **argv) { Display *dpy; int screen; - if((argc >= 2) && !strcmp("-p", argv[1])) { + if (argc < 2) { + char buf[255]; + sprintf(buf, "%s/.slock_passwd", getenv("HOME")); + g_pw = read_pw(buf); + } else if((argc >= 2) && !strcmp("-p", argv[1])) { g_pw = strdup(argv[2]); } else if((argc >= 2) && !strcmp("-f", argv[1])) { g_pw = read_pw(argv[2]);