about summary refs log tree commit diff
path: root/platforms/linux/xorg/slock/slock-mediakeys.diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-12-05 12:10:33 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-12-05 12:10:33 +0100
commitbb668c1bdfb2937e2ca987426aac6cfe1b544fc9 (patch)
treed79cf81c85816f0f93992265a9f460ce5ac3bcb8 /platforms/linux/xorg/slock/slock-mediakeys.diff
parent48c708af222cd4120d81565200e046dc3414b3b1 (diff)
downloaddots-bb668c1bdfb2937e2ca987426aac6cfe1b544fc9.tar.gz
dots-bb668c1bdfb2937e2ca987426aac6cfe1b544fc9.zip
Add slock mediakeys and xautolock
Diffstat (limited to 'platforms/linux/xorg/slock/slock-mediakeys.diff')
-rw-r--r--platforms/linux/xorg/slock/slock-mediakeys.diff31
1 files changed, 31 insertions, 0 deletions
diff --git a/platforms/linux/xorg/slock/slock-mediakeys.diff b/platforms/linux/xorg/slock/slock-mediakeys.diff
new file mode 100644
index 0000000..098eb02
--- /dev/null
+++ b/platforms/linux/xorg/slock/slock-mediakeys.diff
@@ -0,0 +1,31 @@
+diff --git a/slock.c b/slock.c
+index 5ae738c..bd54be2 100644
+--- a/slock.c
++++ b/slock.c
+@@ -18,6 +18,7 @@
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+ #include <X11/XKBlib.h>
++#include <X11/XF86keysym.h>
+
+ #include "arg.h"
+ #include "util.h"
+@@ -157,6 +158,18 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
+ 			    IsPrivateKeypadKey(ksym))
+ 				continue;
+ 			switch (ksym) {
++      case XF86XK_AudioPlay:
++      case XF86XK_AudioStop:
++      case XF86XK_AudioPrev:
++      case XF86XK_AudioNext:
++      case XF86XK_AudioRaiseVolume:
++      case XF86XK_AudioLowerVolume:
++      case XF86XK_AudioMute:
++      case XF86XK_AudioMicMute:
++      case XF86XK_MonBrightnessDown:
++      case XF86XK_MonBrightnessUp:
++        XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
++        break;
+ 			case XK_Return:
+ 				passwd[len] = '\0';
+ 				errno = 0;