wmstatus: add a shortcut for DPMS standby
This commit is contained in:
parent
8fe6b1c8a9
commit
7e730c42bd
12
wmstatus.c
12
wmstatus.c
|
@ -2343,6 +2343,16 @@ on_brightness (struct app_context *ctx, int arg)
|
||||||
free (value);
|
free (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
static void
|
||||||
on_lock_group (struct app_context *ctx, int arg)
|
on_lock_group (struct app_context *ctx, int arg)
|
||||||
{
|
{
|
||||||
|
@ -2388,6 +2398,8 @@ g_keys[] =
|
||||||
{ 0, XF86XK_MonBrightnessUp, on_brightness, 10 },
|
{ 0, XF86XK_MonBrightnessUp, on_brightness, 10 },
|
||||||
{ 0, XF86XK_MonBrightnessDown, on_brightness, -10 },
|
{ 0, XF86XK_MonBrightnessDown, on_brightness, -10 },
|
||||||
|
|
||||||
|
{ Mod4Mask, XK_Pause, on_standby, 0 },
|
||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
{ Mod4Mask, XK_Insert, on_volume_switch, 0 },
|
{ Mod4Mask, XK_Insert, on_volume_switch, 0 },
|
||||||
{ Mod4Mask, XK_Delete, on_volume_mute, 0 },
|
{ Mod4Mask, XK_Delete, on_volume_mute, 0 },
|
||||||
|
|
Loading…
Reference in New Issue