[wiki] [sites] [slock] Add mediakeys patch || Klemens Nanni
commit 7eda223d307016fcb145e3c0d0b13145dd7339e2
Author: Klemens Nanni <kl3_AT_posteo.org>
Date: Wed Aug 31 22:35:24 2016 +0200
[slock] Add mediakeys patch
diff --git a/tools.suckless.org/slock/patches/mediakeys.md b/tools.suckless.org/slock/patches/mediakeys.md
new file mode 100644
index 0000000..3bf57b0
--- /dev/null
+++ b/tools.suckless.org/slock/patches/mediakeys.md
_AT_@ -0,0 +1,27 @@
+Mediakeys
+=========
+
+Description
+-----------
+This patch allows using the following keys to be used while the screen is
+locked:
+ - XF86AudioLowerVolume
+ - XF86AudioMute
+ - XF86AudioRaiseVolume
+ - XF86AudioPlay
+ - XF86AudioStop
+ - XF86AudioPrev
+ - XF86AudioNext
+
+I don't want to unlock the screen just in order to skip the current song
+or raise the volume, that's all there is to it.
+
+Download
+--------
+
+* [slock-mediakeys-20163108-137f007.diff](slock-mediakeys-20163108-137f007.diff)
+
+Authors
+-------
+
+* Klemens Nanni <[kl3_AT_posteo.org](mailto:kl3_AT_posteo.org)>
diff --git a/tools.suckless.org/slock/patches/slock-mediakeys-20163108-137f007.diff b/tools.suckless.org/slock/patches/slock-mediakeys-20163108-137f007.diff
new file mode 100644
index 0000000..78da686
--- /dev/null
+++ b/tools.suckless.org/slock/patches/slock-mediakeys-20163108-137f007.diff
_AT_@ -0,0 +1,41 @@
+From c03df76eb95b4e5657432211c6c4572a767db787 Mon Sep 17 00:00:00 2001
+From: Klemens Nanni <kl3_AT_posteo.org>
+Date: Tue, 30 Aug 2016 22:25:47 +0200
+Subject: [PATCH] Apply slock-mediakeys-20163008-137f007.diff
+
+This allows media hotkeys to be used while the screen is locked.
+---
+ slock.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/slock.c b/slock.c
+index 9ec2f71..da3bb2a 100644
+--- a/slock.c
++++ b/slock.c
+_AT_@ -17,6 +17,7 @@
+ #include <X11/keysym.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
++#include <X11/XF86keysym.h>
+
+ #if HAVE_BSD_AUTH
+ #include <login_cap.h>
+_AT_@ -188,6 +189,15 @@ readpw(Display *dpy, const char *pws)
+ if (len)
+ passwd[len--] = 0;
+ break;
++ case XF86XK_AudioLowerVolume:
++ case XF86XK_AudioMute:
++ case XF86XK_AudioRaiseVolume:
++ case XF86XK_AudioPlay:
++ case XF86XK_AudioStop:
++ case XF86XK_AudioPrev:
++ case XF86XK_AudioNext:
++ XSendEvent(dpy, locks[0]->root, True, KeyPressMask, &ev);
++ break;
+ default:
+ if (num && !iscntrl((int)buf[0]) && (len + num < sizeof(passwd))) {
+ memcpy(passwd + len, buf, num);
+--
+2.8.3
+
Received on Wed Aug 31 2016 - 22:35:33 CEST
This archive was generated by hypermail 2.3.0
: Wed Aug 31 2016 - 22:36:14 CEST