Allow different modifier keys for showing hidden i3bar.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user