aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-04-20 22:44:16 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-04-20 22:44:16 +0200
commit3fa11cbbfa10ff0bec59ba8140dd81b0afb6ae3e (patch)
treea8dbdb764e40cf8ae279f33b4e9452bd7a577e78
parent8c81d7ec829c43c3cd8031d98e27d6ccbb9ab77f (diff)
downloaddesktop-tools-3fa11cbbfa10ff0bec59ba8140dd81b0afb6ae3e.tar.gz
desktop-tools-3fa11cbbfa10ff0bec59ba8140dd81b0afb6ae3e.tar.xz
desktop-tools-3fa11cbbfa10ff0bec59ba8140dd81b0afb6ae3e.zip
dwmstatus: add bindings for kbd layout switching
-rw-r--r--dwmstatus.c12
1 files changed, 12 insertions, 0 deletions
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 },