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

@ -446,6 +446,9 @@ CFGFUN(bar_modifier, const char *modifier) {
current_bar->modifier = M_CONTROL;
else if (strcmp(modifier, "Shift") == 0)
current_bar->modifier = M_SHIFT;
else if (strcmp(modifier, "none") == 0 ||
strcmp(modifier, "off") == 0)
current_bar->modifier = M_NONE;
}
static void bar_configure_binding(const char *button, const char *command) {
@ -575,6 +578,7 @@ CFGFUN(bar_start) {
TAILQ_INIT(&(current_bar->bar_bindings));
TAILQ_INIT(&(current_bar->tray_outputs));
current_bar->tray_padding = 2;
current_bar->modifier = M_MOD4;
}
CFGFUN(bar_finish) {

View File

@ -611,6 +611,9 @@ static void dump_bar_config(yajl_gen gen, Barconfig *config) {
ystr("modifier");
switch (config->modifier) {
case M_NONE:
ystr("none");
break;
case M_CONTROL:
ystr("ctrl");
break;
@ -626,11 +629,6 @@ static void dump_bar_config(yajl_gen gen, Barconfig *config) {
case M_MOD3:
ystr("Mod3");
break;
/*
case M_MOD4:
ystr("Mod4");
break;
*/
case M_MOD5:
ystr("Mod5");
break;