Also fallback when using just 'bind' to be backward-compatible
*Syntax*:
----------------------------------
bindsym [Modifiers+]keysym command
*Syntax*:
----------------------------------
bindsym [Modifiers+]keysym command
-bind [Modifiers+]keycode command
+bindcode [Modifiers+]keycode command
----------------------------------
*Examples*:
----------------------------------
*Examples*:
bindsym Mod1+Shift+r restart
# Notebook-specific hotkeys
bindsym Mod1+Shift+r restart
# Notebook-specific hotkeys
-bind 214 exec /home/michael/toggle_beamer.sh
+bindcode 214 exec /home/michael/toggle_beamer.sh
--------------------------------
Available Modifiers:
--------------------------------
Available Modifiers:
bindsym d resize right +10
bindsym Shift+d resize right -10
bindsym d resize right +10
bindsym Shift+d resize right -10
+ bindcode 36 mode default
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# Start terminal (Mod1+Enter)
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# Start terminal (Mod1+Enter)
-bind Mod1+36 exec /usr/bin/urxvt
+bindcode Mod1+36 exec /usr/bin/urxvt
-bind Mod1+55 exec /usr/bin/dmenu_run
+bindcode Mod1+55 exec /usr/bin/dmenu_run
# Kill current client (Mod1+Shift+q)
# Kill current client (Mod1+Shift+q)
+bindcode Mod1+Shift+24 kill
-bind Mod1+73 exec /home/michael/toggle_beamer.sh
+bindcode Mod1+73 exec /home/michael/toggle_beamer.sh
-bind Mod1+68 exec /usr/bin/i3lock
+bindcode Mod1+68 exec /usr/bin/i3lock
# Restart i3 inplace (Mod1+Shift+r)
# Restart i3 inplace (Mod1+Shift+r)
-bind Mod1+Shift+27 restart
+bindcode Mod1+Shift+27 restart
+bindcode Mod1+Shift+26 exit
-bind Mod1+97 exec sudo sh -c "echo up > /proc/acpi/ibm/brightness"
-bind Mod1+103 exec sudo sh -c "echo down > /proc/acpi/ibm/brightness"
+bindcode Mod1+97 exec sudo sh -c "echo up > /proc/acpi/ibm/brightness"
+bindcode Mod1+103 exec sudo sh -c "echo down > /proc/acpi/ibm/brightness"
# Toggle tiling/floating of the current window (Mod1+Shift+Space)
# Toggle tiling/floating of the current window (Mod1+Shift+Space)
+bindcode Mod1+Shift+65 t
# Go into the tiling layer / floating layer, depending on whether
# the current window is tiling / floating (Mod1+t)
# Go into the tiling layer / floating layer, depending on whether
# the current window is tiling / floating (Mod1+t)
+bindcode Mod1+28 focus ft
-bind Mod1+44 h
-bind Mod1+45 j
-bind Mod1+46 k
-bind Mod1+47 l
+bindcode Mod1+44 h
+bindcode Mod1+45 j
+bindcode Mod1+46 k
+bindcode Mod1+47 l
# Focus Container (Mod3+j/k/l/;)
# Focus Container (Mod3+j/k/l/;)
-bind Mod3+44 wch
-bind Mod3+45 wcj
-bind Mod3+46 wck
-bind Mod3+47 wcl
+bindcode Mod3+44 wch
+bindcode Mod3+45 wcj
+bindcode Mod3+46 wck
+bindcode Mod3+47 wcl
# Snap (Mod1+Control+j/k/l/;)
# Snap (Mod1+Control+j/k/l/;)
-bind Mod1+Control+44 sh
-bind Mod1+Control+45 sj
-bind Mod1+Control+46 sk
-bind Mod1+Control+47 sl
+bindcode Mod1+Control+44 sh
+bindcode Mod1+Control+45 sj
+bindcode Mod1+Control+46 sk
+bindcode Mod1+Control+47 sl
# Move (Mod1+Shift+j/k/l/;)
# Move (Mod1+Shift+j/k/l/;)
-bind Mod1+Shift+44 mh
-bind Mod1+Shift+45 mj
-bind Mod1+Shift+46 mk
-bind Mod1+Shift+47 ml
+bindcode Mod1+Shift+44 mh
+bindcode Mod1+Shift+45 mj
+bindcode Mod1+Shift+46 mk
+bindcode Mod1+Shift+47 ml
# Move Container (Mod3+Shift+j/k/l/;)
# Move Container (Mod3+Shift+j/k/l/;)
-bind Mod3+Shift+44 wcmh
-bind Mod3+Shift+45 wcmj
-bind Mod3+Shift+46 wcmk
-bind Mod3+Shift+47 wcml
+bindcode Mod3+Shift+44 wcmh
+bindcode Mod3+Shift+45 wcmj
+bindcode Mod3+Shift+46 wcmk
+bindcode Mod3+Shift+47 wcml
-bind Mod1+10 1
-bind Mod1+11 2
+bindcode Mod1+10 1
+bindcode Mod1+11 2
-bind Mod1+Shift+10 1
-bind Mod1+Shift+11 2
+bindcode Mod1+Shift+10 1
+bindcode Mod1+Shift+11 2
...
-------------------------------------------------------------
...
-------------------------------------------------------------
%s BINDSYM_COND
%s BIND_AWS_COND
%s BINDSYM_AWS_COND
%s BINDSYM_COND
%s BIND_AWS_COND
%s BINDSYM_AWS_COND
<COLOR_COND>[0-9a-fA-F]+ { yylval.string = strdup(yytext); return HEX; }
[0-9]+ { yylval.number = atoi(yytext); return NUMBER; }
mode { return TOKMODE; }
<COLOR_COND>[0-9a-fA-F]+ { yylval.string = strdup(yytext); return HEX; }
[0-9]+ { yylval.number = atoi(yytext); return NUMBER; }
mode { return TOKMODE; }
-bind { BEGIN(BIND_COND); return TOKBIND; }
+bind { BEGIN(BINDCODE_COND); return TOKBINDCODE; }
+bindcode { BEGIN(BINDCODE_COND); return TOKBINDCODE; }
bindsym { BEGIN(BINDSYM_COND); return TOKBINDSYM; }
floating_modifier { BEGIN(INITIAL); return TOKFLOATING_MODIFIER; }
workspace { BEGIN(INITIAL); return TOKWORKSPACE; }
bindsym { BEGIN(BINDSYM_COND); return TOKBINDSYM; }
floating_modifier { BEGIN(INITIAL); return TOKFLOATING_MODIFIER; }
workspace { BEGIN(INITIAL); return TOKWORKSPACE; }
BEGIN(INITIAL);
yy_push_state(BUFFER_LINE);
}
BEGIN(INITIAL);
yy_push_state(BUFFER_LINE);
}
-<BIND_COND>[ \t]+ { BEGIN(BIND_AWS_COND); return WHITESPACE; }
+<BINDCODE_COND>[ \t]+ { BEGIN(BIND_AWS_COND); return WHITESPACE; }
<BINDSYM_COND>[ \t]+ { BEGIN(BINDSYM_AWS_COND); return WHITESPACE; }
<BIND_AWS_COND>[ \t]+ { BEGIN(BIND_A2WS_COND); return WHITESPACE; }
<BINDSYM_AWS_COND>[ \t]+ { BEGIN(BIND_A2WS_COND); return WHITESPACE; }
<BINDSYM_COND>[ \t]+ { BEGIN(BINDSYM_AWS_COND); return WHITESPACE; }
<BIND_AWS_COND>[ \t]+ { BEGIN(BIND_A2WS_COND); return WHITESPACE; }
<BINDSYM_AWS_COND>[ \t]+ { BEGIN(BIND_A2WS_COND); return WHITESPACE; }
%token <string>STR_NG "<string (non-greedy)>"
%token <string>HEX "<hex>"
%token <string>OUTPUT "<RandR output>"
%token <string>STR_NG "<string (non-greedy)>"
%token <string>HEX "<hex>"
%token <string>OUTPUT "<RandR output>"
%token TOKTERMINAL
%token TOKCOMMENT "<comment>"
%token TOKFONT "font"
%token TOKTERMINAL
%token TOKCOMMENT "<comment>"
%token TOKFONT "font"
- TOKBIND WHITESPACE bind { $<binding>$ = $<binding>3; }
+ TOKBINDCODE WHITESPACE bindcode { $<binding>$ = $<binding>3; }
| TOKBINDSYM WHITESPACE bindsym { $<binding>$ = $<binding>3; }
;
| TOKBINDSYM WHITESPACE bindsym { $<binding>$ = $<binding>3; }
;
binding_modifiers NUMBER WHITESPACE command
{
binding_modifiers NUMBER WHITESPACE command
{
- printf("\tFound binding mod%d with key %d and command %s\n", $<number>1, $2, $<string>4);
+ printf("\tFound keycode binding mod%d with key %d and command %s\n", $<number>1, $2, $<string>4);
Binding *new = scalloc(sizeof(Binding));
new->keycode = $<number>2;
Binding *new = scalloc(sizeof(Binding));
new->keycode = $<number>2;
bindsym:
binding_modifiers word_or_number WHITESPACE command
{
bindsym:
binding_modifiers word_or_number WHITESPACE command
{
- printf("\tFound symbolic mod%d with key %s and command %s\n", $<number>1, $<string>2, $<string>4);
+ printf("\tFound keysym binding mod%d with key %s and command %s\n", $<number>1, $<string>2, $<string>4);
Binding *new = scalloc(sizeof(Binding));
new->symbol = $<string>2;
Binding *new = scalloc(sizeof(Binding));
new->symbol = $<string>2;