dwmstatus: add bindings for kbd layout switching

This commit is contained in:
Přemysl Eric Janouch 2016-04-20 22:44:16 +02:00
parent 8c81d7ec82
commit 3fa11cbbfa

View File

@ -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 },