mediakeys patch
- Apply mediakeys patch - Update README with link to mediakeys patch - Add diff to patches folder
This commit is contained in:
@@ -31,3 +31,4 @@ The configuration of slock is done by creating a custom config.h and (re)compili
|
|||||||
Most patches can be found on the suckless website: [https://tools.suckless.org/slock/patches/](https://tools.suckless.org/slock/patches/)
|
Most patches can be found on the suckless website: [https://tools.suckless.org/slock/patches/](https://tools.suckless.org/slock/patches/)
|
||||||
|
|
||||||
* [capscolor](https://tools.suckless.org/slock/patches/capscolor/) - Introduces an additional color to indicate the state of Caps Lock.
|
* [capscolor](https://tools.suckless.org/slock/patches/capscolor/) - Introduces an additional color to indicate the state of Caps Lock.
|
||||||
|
* [mediakeys](https://tools.suckless.org/slock/patches/mediakeys/) - Allows use of media keys while screen is locked
|
||||||
|
31
patches/slock-mediakeys-1.4.diff
Normal file
31
patches/slock-mediakeys-1.4.diff
Normal file
@@ -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/keysym.h>
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.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;
|
13
slock.c
13
slock.c
@@ -19,6 +19,7 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
#include <X11/XF86keysym.h>
|
||||||
|
|
||||||
#include "arg.h"
|
#include "arg.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
@@ -163,6 +164,18 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
|
|||||||
IsPrivateKeypadKey(ksym))
|
IsPrivateKeypadKey(ksym))
|
||||||
continue;
|
continue;
|
||||||
switch (ksym) {
|
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:
|
case XK_Return:
|
||||||
passwd[len] = '\0';
|
passwd[len] = '\0';
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
Reference in New Issue
Block a user