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

Multiple keybindings per bindsym command?

asked 2014-12-07 18:36:24 +0000

tasinet gravatar image

I'm a lazy, lazy (lazy) man.

I'm so lazy that I sometimes forget to lift my finger off of $mod when I enter a mode, so I like my bindings to cover both $key and $mod+$key.

My config therefore repeats a a bit bit:

set $mode_resize "RESIZE [←]width- [→]width+ [↑]height+ [↓]height-"
bindsym $mod+r mode $mode_resize
mode $mode_resize {
    bindsym Up          resize grow     height  10 px or 10 ppt
    bindsym $mod+Up     resize grow     height  10 px or 10 ppt

    bindsym Down        resize shrink   height  10 px or 10 ppt
    bindsym $mod+Down   resize shrink   height  10 px or 10 ppt

    bindsym Left        resize shrink   width   10 px or 10 ppt
    bindsym $mod+Left   resize shrink   width   10 px or 10 ppt

    bindsym Right       resize grow     width   10 px or 10 ppt
    bindsym $mod+Right  resize grow     width   10 px or 10 ppt

    ...

I don't mind too much, as I keep things aligned so I can edit multiple lines painlessly in vim, but:

Is there a way for a single bindsym command to bind to 2 symbols? Some form of bindsym {Right,$mod+Right} command?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2014-12-07 18:41:51 +0000

Michael gravatar image

No. I also think we’ll want to keep it that way to keep the configuration file (and its parser) simple. Logic for not repeating yourself too often is consciously pushed out of the config mechanism itself, in this case either into your editor or, if you really wanted to, a shell script or other wrapper around the configuration file :).

edit flag offensive delete link more

Comments

Thanks for the prompt reply! No worries, I was just wondering if I was missing something.

tasinet gravatar imagetasinet ( 2014-12-07 18:48:02 +0000 )edit

Question Tools

Stats

Asked: 2014-12-07 18:36:24 +0000

Seen: 324 times

Last updated: Dec 07 '14