Allow different modifier keys for showing hidden i3bar.

This commit is contained in:
dbp
2011-12-11 21:58:57 -08:00
committed by Michael Stapelberg
parent f88c779457
commit a3081c488a
7 changed files with 152 additions and 7 deletions

View File

@ -15,6 +15,8 @@
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include <X11/Xlib.h>
#include "common.h"
static char *cur_key;
@ -75,6 +77,41 @@ static int config_string_cb(void *params_, const unsigned char *val, unsigned in
return 1;
}
if (!strcmp(cur_key, "modifier")) {
DLOG("modifier = %.*s\n", len, val);
if (len == 5 && !strncmp((const char*)val, "shift", strlen("shift"))) {
config.modifier = ShiftMask;
return 1;
}
if (len == 4 && !strncmp((const char*)val, "ctrl", strlen("ctrl"))) {
config.modifier = ControlMask;
return 1;
}
if (len == 4 && !strncmp((const char*)val, "Mod", strlen("Mod"))) {
switch (val[3]) {
case '1':
config.modifier = Mod1Mask;
return 1;
case '2':
config.modifier = Mod2Mask;
return 1;
case '3':
config.modifier = Mod3Mask;
return 1;
/*
case '4':
config.modifier = Mod4Mask;
return 1;
*/
case '5':
config.modifier = Mod5Mask;
return 1;
}
}
config.modifier = Mod4Mask;
return 1;
}
if (!strcmp(cur_key, "position")) {
DLOG("position = %.*s\n", len, val);
config.position = (len == 3 && !strncmp((const char*)val, "top", strlen("top")) ? POS_TOP : POS_BOT);