diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-02-09 20:17:49 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-02-09 20:17:49 +0100 |
commit | 3d855284ec3e03fa2b96166097761074350ab847 (patch) | |
tree | 53c54036be2fefbefe079c797f95134f3281a42f | |
parent | fee703567f1b5fce7d7ff2118024b39577bf8711 (diff) | |
download | desktop-tools-3d855284ec3e03fa2b96166097761074350ab847.tar.gz desktop-tools-3d855284ec3e03fa2b96166097761074350ab847.tar.xz desktop-tools-3d855284ec3e03fa2b96166097761074350ab847.zip |
wmstatus: integrate input-source
-rw-r--r-- | wmstatus.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -2200,6 +2200,14 @@ on_lock (struct app_context *ctx, int arg) } 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) { char *value = xstrdup_printf ("%d", 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 }, |