aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-08 12:37:26 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-08 12:37:26 +0200
commit7e730c42bd861599fe3852093bf185903243d0ec (patch)
tree9714a4262fff46f07dee0aa5aec3160ced79a770
parent8fe6b1c8a9572d0be18d4f23f0f8b28c98cb92cd (diff)
downloaddesktop-tools-7e730c42bd861599fe3852093bf185903243d0ec.tar.gz
desktop-tools-7e730c42bd861599fe3852093bf185903243d0ec.tar.xz
desktop-tools-7e730c42bd861599fe3852093bf185903243d0ec.zip
wmstatus: add a shortcut for DPMS standby
-rw-r--r--wmstatus.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/wmstatus.c b/wmstatus.c
index 74b8468..404f422 100644
--- a/wmstatus.c
+++ b/wmstatus.c
@@ -2344,6 +2344,16 @@ on_brightness (struct app_context *ctx, int arg)
}
static void
+on_standby (struct app_context *ctx, int arg)
+{
+ (void) ctx;
+ (void) arg;
+
+ // We need to wait a little while until user releases the key
+ spawn ((char *[]) { "sh", "-c", "sleep 1; xset dpms force standby", NULL });
+}
+
+static void
on_lock_group (struct app_context *ctx, int arg)
{
XkbLockGroup (ctx->dpy, XkbUseCoreKbd, arg);
@@ -2388,6 +2398,8 @@ g_keys[] =
{ 0, XF86XK_MonBrightnessUp, on_brightness, 10 },
{ 0, XF86XK_MonBrightnessDown, on_brightness, -10 },
+ { Mod4Mask, XK_Pause, on_standby, 0 },
+
// Volume
{ Mod4Mask, XK_Insert, on_volume_switch, 0 },
{ Mod4Mask, XK_Delete, on_volume_mute, 0 },