From 3fa11cbbfa10ff0bec59ba8140dd81b0afb6ae3e Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Wed, 20 Apr 2016 22:44:16 +0200 Subject: dwmstatus: add bindings for kbd layout switching --- dwmstatus.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dwmstatus.c b/dwmstatus.c index a1b72d7..daedb81 100644 --- a/dwmstatus.c +++ b/dwmstatus.c @@ -2710,6 +2710,12 @@ on_brightness (struct app_context *ctx, int arg) free (value); } +static void +on_lock_group (struct app_context *ctx, int arg) +{ + XkbLockGroup (ctx->dpy, XkbUseCoreKbd, arg); +} + struct { unsigned mod; @@ -2731,6 +2737,12 @@ g_keys[] = { Mod4Mask | Mod5Mask, XK_Left, on_mpd_backward, 0 }, { Mod4Mask | Mod5Mask, XK_Right, on_mpd_forward, 0 }, + // 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 }, + // Brightness { Mod4Mask, XK_Home, on_brightness, 10 }, { Mod4Mask, XK_End, on_brightness, -10 }, -- cgit v1.2.3-70-g09d2