The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

"un-bindsym" or "bindsym" for mode "default"

asked 2014-08-31 12:06:14 +0000

nishantjr gravatar image

updated 2014-08-31 12:07:19 +0000

I was trying to use the function keys as application launchers, but then realized some of the software I use (htop, alsamixer) require them.

After realizing that there isn't an un-bindsym command, I tried using bindsym in mode default like so:

mode "default" {                      

  bindsym F1 exec my-browser                                                  
  bindsym F2 exec i3-sensible-terminal                  

  bindsym F3 mode "curses"                                                     
  bindsym F12 exec my-backlight-menu
}

This cause i3 to exit. Looking through the source, there was a specific check for this, that after removing let my configuration work fine without any problems.


I'm wondering if this check is necessary? Or is there another way of implementing my configuration without modifying i3?

Patch
diff --git a/src/config_directives.c b/src/config_directives.c
index e45db0e..8191fb5 100644
--- a/src/config_directives.c
+++ b/src/config_directives.c
@@ -186,10 +186,6 @@ CFGFUN(mode_binding, const char *bindtype, const char *modifiers, const char *ke
 }

 CFGFUN(enter_mode, const char *modename) {
-    if (strcasecmp(modename, DEFAULT_BINDING_MODE) == 0) {
-        ELOG("You cannot use the name %s for your mode\n", DEFAULT_BINDING_MODE);
-        exit(1);
-    }
     DLOG("\t now in mode %s\n", modename);
     FREE(current_mode);
     current_mode = sstrdup(modename);
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-08-31 13:44:25 +0000

nishantjr gravatar image

I misunderstood how modes worked: When switching from one mode to another, all bindsyms are removed.

This means that none of the bindings from the default mode are carried over to other modes. So, bindsyms in the default mode behave identically to those at the top-level and are thus nonsensical.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-08-31 12:06:14 +0000

Seen: 78 times

Last updated: Aug 31 '14