wmstatus: integrate input-source

This commit is contained in:
Přemysl Eric Janouch 2017-02-09 20:17:49 +01:00
parent fee703567f
commit 3d855284ec
Signed by: p
GPG Key ID: B715679E3A361BE6

View File

@ -2199,6 +2199,14 @@ on_lock (struct app_context *ctx, int arg)
spawn (ctx, argv_ldm);
}
static void
on_input_switch (struct app_context *ctx, int arg)
{
char *values[] = { "vga", "dvi", "dp", "hdmi" };
char *argv[] = { "input-switch", values[arg], NULL };
spawn (ctx, argv);
}
static void
on_brightness (struct app_context *ctx, int arg)
{
@ -2235,6 +2243,12 @@ g_keys[] =
{ Mod4Mask | Mod5Mask, XK_Left, on_mpd_backward, 0 },
{ Mod4Mask | Mod5Mask, XK_Right, on_mpd_forward, 0 },
// Display input sources
{ Mod4Mask, XK_F5, on_input_switch, 0 },
{ Mod4Mask, XK_F6, on_input_switch, 1 },
{ Mod4Mask, XK_F7, on_input_switch, 2 },
{ Mod4Mask, XK_F8, on_input_switch, 3 },
// Keyboard groups
{ Mod4Mask, XK_F9, on_lock_group, 0 },
{ Mod4Mask, XK_F10, on_lock_group, 1 },