1
0
mirror of https://github.com/alrayyes/slock synced 2023-11-13 18:16:41 +00:00

added mediakeys patch

This commit is contained in:
Ryan Kes 2019-03-13 21:32:25 +01:00
parent 19c4345365
commit b4edfa8ba0
2 changed files with 36 additions and 2 deletions

View File

@ -14,12 +14,13 @@ source=("http://dl.suckless.org/tools/$pkgname-$pkgver.tar.gz")
sha256sums=('b53849dbc60109a987d7a49b8da197305c29307fd74c12dc18af0d3044392e6a'
'97c09fd6f7e0aff3002a24dabe57798bcfaa1467a043cf7b7119177f005e5848'
'0d5508c24ab2e870f1d807044c08c7c4f835e696267ecca7521b08f59bc803d1'
'e4f1401e0f6a2615e3c1a6ab204e84b83917388d77247c311bf7902f1245b373')
'e4f1401e0f6a2615e3c1a6ab204e84b83917388d77247c311bf7902f1245b373'
'1c46c67980e367321b3d243f843cd34465a2c7dff242b79e1f07b3a5e434e13b')
_patches=("slock-dpms-20170923-fa11589.diff"
"local-quickcancel-20160619-65b8d52.diff"
"local-mediakeys-20170111-2d2a21a.diff"
#"slock-message-20180626-35633d4.diff"
#"slock-mediakeys-20170111-2d2a21a.diff"
#"slock-1.2-background-image.diff"
)

View File

@ -0,0 +1,33 @@
diff -up a/slock.c b/slock.c
--- a/slock.c
+++ b/slock.c
@@ -18,6 +18,7 @@
#include <X11/extensions/Xrandr.h>
#include <X11/extensions/dpms.h>
#include <X11/keysym.h>
+#include <X11/XF86keysym.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -180,6 +181,21 @@ readpw(Display *dpy, struct xrandr *rr,
explicit_bzero(&passwd, sizeof(passwd));
len = 0;
break;
+ case XF86XK_AudioRaiseVolume:
+ XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
+ break;
+ case XF86XK_AudioLowerVolume:
+ XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
+ break;
+ case XF86XK_AudioMute:
+ XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
+ break;
+ case XF86XK_MonBrightnessUp:
+ XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
+ break;
+ case XF86XK_MonBrightnessDown:
+ XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
+ break;
case XK_BackSpace:
if (len)
passwd[len--] = '\0';