Allow "modifier none" in i3bar to disable the modifier.

This allows "modifier none" (and "modifier off") for the bar config
in order to disable the modifier key altogether. This is useful
for users who use a different approach to hiding / showing the bar,
e.g., a custom keybind that involved multiple keys or scripts.

fixes #2208
This commit is contained in:
Ingo Bürk
2016-02-11 19:57:32 +01:00
parent e2d1f0f567
commit 018922dcc4
6 changed files with 18 additions and 14 deletions

View File

@ -121,6 +121,11 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
if (!strcmp(cur_key, "modifier")) {
DLOG("modifier = %.*s\n", len, val);
if (len == 4 && !strncmp((const char *)val, "none", strlen("none"))) {
config.modifier = XCB_NONE;
return 1;
}
if (len == 5 && !strncmp((const char *)val, "shift", strlen("shift"))) {
config.modifier = ShiftMask;
return 1;
@ -140,16 +145,12 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
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;
}