[wiki] [sites] [slock] Apply new patch naming scheme for quickcancel and terminalkeys || Matthias Schoth

From: <git_AT_suckless.org>
Date: Sun, 19 Jun 2016 01:22:25 +0200

commit 1fe26a473346f1df1a3cc46dc154226101066c51
Author: Matthias Schoth <mschoth_AT_gmail.com>
Date: Sun Jun 19 01:20:48 2016 +0200

    [slock] Apply new patch naming scheme for quickcancel and terminalkeys

diff --git a/tools.suckless.org/slock/patches/quickcancel.md b/tools.suckless.org/slock/patches/quickcancel.md
index 3da527c..56623b8 100644
--- a/tools.suckless.org/slock/patches/quickcancel.md
+++ b/tools.suckless.org/slock/patches/quickcancel.md
_AT_@ -19,7 +19,7 @@ in `config.h` via the `timetocancel` option.
 Download
 --------
 
- * [slock-20160316-quickcancel.diff](slock-20160316-quickcancel.diff)
+ * [slock-quickcancel-20160619-65b8d52.diff](slock-quickcancel-20160619-65b8d52.diff)
 
 Authors
 -------
diff --git a/tools.suckless.org/slock/patches/slock-20160316-quickcancel.diff b/tools.suckless.org/slock/patches/slock-20160316-quickcancel.diff
deleted file mode 100644
index 4317099..0000000
--- a/tools.suckless.org/slock/patches/slock-20160316-quickcancel.diff
+++ /dev/null
_AT_@ -1,47 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index eae2d9a..fbc8f13 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -6,3 +6,6 @@ static const char *colorname[NUMCOLS] = {
-
- /* treat a cleared input like a wrong password */
- static const int failonclear = 1;
-+
-+/* time to cancel lock with mouse movement in seconds */
-+static const int timetocancel = 3;
-diff --git a/slock.c b/slock.c
-index c9cdee2..a187d7a 100644
---- a/slock.c
-+++ b/slock.c
-_AT_@ -12,6 +12,7 @@
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
-+#include <time.h>
- #include <sys/types.h>
- #include <X11/extensions/Xrandr.h>
- #include <X11/keysym.h>
-_AT_@ -46,6 +47,7 @@ static Bool failure = False;
- static Bool rr;
- static int rrevbase;
- static int rrerrbase;
-+static time_t tim;
-
- static void
- die(const char *errstr, ...)
-_AT_@ -134,6 +136,7 @@ readpw(Display *dpy, const char *pws)
- * utility. This way the user can easily set a customized DPMS
- * timeout. */
- while (running && !XNextEvent(dpy, &ev)) {
-+ running = !((time(NULL) - tim < timetocancel) && (ev.type == MotionNotify));
- if (ev.type == KeyPress) {
- buf[0] = 0;
- num = XLookupString(&ev.xkey, buf, sizeof(buf), &ksym, 0);
-_AT_@ -261,6 +264,7 @@ lockscreen(Display *dpy, int screen)
- if (XGrabKeyboard(dpy, lock->root, True, GrabModeAsync, GrabModeAsync, CurrentTime) == GrabSuccess) {
- /* everything fine, we grabbed both inputs */
- XSelectInput(dpy, lock->root, SubstructureNotifyMask);
-+ tim = time(NULL);
- return lock;
- }
- usleep(1000);
diff --git a/tools.suckless.org/slock/patches/slock-20160618-terminalkeys.diff b/tools.suckless.org/slock/patches/slock-20160618-terminalkeys.diff
deleted file mode 100644
index afcb874..0000000
--- a/tools.suckless.org/slock/patches/slock-20160618-terminalkeys.diff
+++ /dev/null
_AT_@ -1,27 +0,0 @@
-diff --git a/slock.c b/slock.c
-index c9cdee2..03e191d 100644
---- a/slock.c
-+++ b/slock.c
-_AT_@ -149,6 +149,22 @@ readpw(Display *dpy, const char *pws)
- IsPFKey(ksym) ||
- IsPrivateKeypadKey(ksym))
- continue;
-+ if (ev.xkey.state & ControlMask) {
-+ switch (ksym) {
-+ case XK_u:
-+ ksym = XK_Escape;
-+ break;
-+ case XK_m:
-+ ksym = XK_Return;
-+ break;
-+ case XK_j:
-+ ksym = XK_Return;
-+ break;
-+ case XK_h:
-+ ksym = XK_BackSpace;
-+ break;
-+ }
-+ }
- switch (ksym) {
- case XK_Return:
- passwd[len] = 0;
diff --git a/tools.suckless.org/slock/patches/slock-quickcancel-20160619-65b8d52.diff b/tools.suckless.org/slock/patches/slock-quickcancel-20160619-65b8d52.diff
new file mode 100644
index 0000000..4317099
--- /dev/null
+++ b/tools.suckless.org/slock/patches/slock-quickcancel-20160619-65b8d52.diff
_AT_@ -0,0 +1,47 @@
+diff --git a/config.def.h b/config.def.h
+index eae2d9a..fbc8f13 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -6,3 +6,6 @@ static const char *colorname[NUMCOLS] = {
+
+ /* treat a cleared input like a wrong password */
+ static const int failonclear = 1;
++
++/* time to cancel lock with mouse movement in seconds */
++static const int timetocancel = 3;
+diff --git a/slock.c b/slock.c
+index c9cdee2..a187d7a 100644
+--- a/slock.c
++++ b/slock.c
+_AT_@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <time.h>
+ #include <sys/types.h>
+ #include <X11/extensions/Xrandr.h>
+ #include <X11/keysym.h>
+_AT_@ -46,6 +47,7 @@ static Bool failure = False;
+ static Bool rr;
+ static int rrevbase;
+ static int rrerrbase;
++static time_t tim;
+
+ static void
+ die(const char *errstr, ...)
+_AT_@ -134,6 +136,7 @@ readpw(Display *dpy, const char *pws)
+ * utility. This way the user can easily set a customized DPMS
+ * timeout. */
+ while (running && !XNextEvent(dpy, &ev)) {
++ running = !((time(NULL) - tim < timetocancel) && (ev.type == MotionNotify));
+ if (ev.type == KeyPress) {
+ buf[0] = 0;
+ num = XLookupString(&ev.xkey, buf, sizeof(buf), &ksym, 0);
+_AT_@ -261,6 +264,7 @@ lockscreen(Display *dpy, int screen)
+ if (XGrabKeyboard(dpy, lock->root, True, GrabModeAsync, GrabModeAsync, CurrentTime) == GrabSuccess) {
+ /* everything fine, we grabbed both inputs */
+ XSelectInput(dpy, lock->root, SubstructureNotifyMask);
++ tim = time(NULL);
+ return lock;
+ }
+ usleep(1000);
diff --git a/tools.suckless.org/slock/patches/slock-terminalkeys-20160618-65b8d52.diff b/tools.suckless.org/slock/patches/slock-terminalkeys-20160618-65b8d52.diff
new file mode 100644
index 0000000..afcb874
--- /dev/null
+++ b/tools.suckless.org/slock/patches/slock-terminalkeys-20160618-65b8d52.diff
_AT_@ -0,0 +1,27 @@
+diff --git a/slock.c b/slock.c
+index c9cdee2..03e191d 100644
+--- a/slock.c
++++ b/slock.c
+_AT_@ -149,6 +149,22 @@ readpw(Display *dpy, const char *pws)
+ IsPFKey(ksym) ||
+ IsPrivateKeypadKey(ksym))
+ continue;
++ if (ev.xkey.state & ControlMask) {
++ switch (ksym) {
++ case XK_u:
++ ksym = XK_Escape;
++ break;
++ case XK_m:
++ ksym = XK_Return;
++ break;
++ case XK_j:
++ ksym = XK_Return;
++ break;
++ case XK_h:
++ ksym = XK_BackSpace;
++ break;
++ }
++ }
+ switch (ksym) {
+ case XK_Return:
+ passwd[len] = 0;
diff --git a/tools.suckless.org/slock/patches/terminalkeys.md b/tools.suckless.org/slock/patches/terminalkeys.md
index a01f733..30d56a2 100644
--- a/tools.suckless.org/slock/patches/terminalkeys.md
+++ b/tools.suckless.org/slock/patches/terminalkeys.md
_AT_@ -4,8 +4,8 @@ terminalkeys
 Description
 -----------
 
-Add key commands that are commonly used in terminal applications
-(e.g. bash, login) to slock.
+Add key commands that are commonly used in terminal applications
+(in particular the login prompt) to slock.
 
 Mappings:
 
_AT_@ -20,7 +20,7 @@ Mappings:
 Download
 --------
 
- * [slock-20160618-terminalkeys.diff](slock-20160618-terminalkeys.diff)
+ * [slock-terminalkeys-20160618-65b8d52.diff](slock-terminalkeys-20160618-65b8d52.diff)
 
 Authors
 -------
Received on Sun Jun 19 2016 - 01:22:25 CEST

This archive was generated by hypermail 2.3.0 : Sun Jun 19 2016 - 01:24:16 CEST