From 3d855284ec3e03fa2b96166097761074350ab847 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Thu, 9 Feb 2017 20:17:49 +0100
Subject: wmstatus: integrate input-source
---
wmstatus.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/wmstatus.c b/wmstatus.c
index 0cec5db..00dafdf 100644
--- a/wmstatus.c
+++ b/wmstatus.c
@@ -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 },
--
cgit v1.2.3-70-g09d2