aboutsummaryrefslogtreecommitdiff
path: root/wmstatus.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-05 14:10:48 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-05 14:15:31 +0100
commit4a0e7562355bc9e11dd43b73c20c7ff3e14b6943 (patch)
treed2b7a7ac0ab60d71b76c45910ad5898dcf411183 /wmstatus.c
parent9dc1187b1c9f3092e2c8a645391475a4dd2def15 (diff)
downloaddesktop-tools-4a0e7562355bc9e11dd43b73c20c7ff3e14b6943.tar.gz
desktop-tools-4a0e7562355bc9e11dd43b73c20c7ff3e14b6943.tar.xz
desktop-tools-4a0e7562355bc9e11dd43b73c20c7ff3e14b6943.zip
wmstatus: rebind function keys
They sucked on OLKBs, now we're appropriating F1-F5 with modifiers.
Diffstat (limited to 'wmstatus.c')
-rw-r--r--wmstatus.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/wmstatus.c b/wmstatus.c
index 0e81dc5..260a1ef 100644
--- a/wmstatus.c
+++ b/wmstatus.c
@@ -2305,8 +2305,11 @@ static void
on_input_switch (struct app_context *ctx, int arg)
{
(void) ctx;
- char *values[] = { "vga", "dvi", "dp", "hdmi" };
- char *argv[] = { "input-switch", values[arg], NULL };
+
+ char *values[] = { "vga", "dvi", "hdmi", "dp", "tb" },
+ *numbers[] = { "1", "2" };
+ char *argv[] = { "input-switch",
+ values[arg & 0xf], numbers[arg >> 4], NULL };
spawn (argv);
}
@@ -2424,17 +2427,24 @@ g_keys[] =
{ 0, XF86XK_AudioPrev, on_mpd_prev, 0 },
{ 0, XF86XK_AudioNext, on_mpd_next, 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 },
- { Mod4Mask, XK_F11, on_lock_group, 2 },
- { Mod4Mask, XK_F12, on_lock_group, 3 },
+ { Mod4Mask, XK_F1, on_lock_group, 0 },
+ { Mod4Mask, XK_F2, on_lock_group, 1 },
+ { Mod4Mask, XK_F3, on_lock_group, 2 },
+ { Mod4Mask, XK_F4, on_lock_group, 3 },
+
+#define CSMask (ControlMask | ShiftMask)
+
+ // Display input sources
+ { Mod4Mask | ControlMask, XK_F1, on_input_switch, 0 },
+ { Mod4Mask | CSMask, XK_F1, on_input_switch, 16 | 0 },
+ { Mod4Mask | ControlMask, XK_F2, on_input_switch, 1 },
+ { Mod4Mask | CSMask, XK_F2, on_input_switch, 16 | 1 },
+ { Mod4Mask | ControlMask, XK_F3, on_input_switch, 2 },
+ { Mod4Mask | CSMask, XK_F3, on_input_switch, 16 | 2 },
+ { Mod4Mask | ControlMask, XK_F4, on_input_switch, 3 },
+ { Mod4Mask | CSMask, XK_F4, on_input_switch, 16 | 3 },
+ { Mod4Mask | ControlMask, XK_F5, on_input_switch, 4 },
// Brightness
{ Mod4Mask, XK_Home, on_brightness, 10 },
@@ -2442,8 +2452,8 @@ g_keys[] =
{ 0, XF86XK_MonBrightnessUp, on_brightness, 10 },
{ 0, XF86XK_MonBrightnessDown, on_brightness, -10 },
- { Mod4Mask, XK_F4, on_standby, 0 },
- { Mod4Mask | ShiftMask, XK_F4, on_insomnia, 0 },
+ { Mod4Mask, XK_F5, on_standby, 0 },
+ { Mod4Mask | ShiftMask, XK_F5, on_insomnia, 0 },
{ Mod4Mask, XK_Pause, on_standby, 0 },
{ Mod4Mask | ShiftMask, XK_Pause, on_insomnia, 0 },