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

Multiple commands to a keybind

asked 2013-04-26 22:24:32 +0000

Luye gravatar image

I am wanting to have a seperate "stack" of workspaces for each monitor. To do this, I need to run two commands by the same keybind. Along the lines of this

bindsym $mod+1 workspace 1 bindsym $mod+1 move workspace to output right . ...

bindsym $mod2+1 workspace 11 bindsym $mod2+1 move workspace to output left . ...

(unrelated: $mod2 = Control)

This config is not accepted however. And if I try to combine them it will behave the same, but create workspace "1 to output right".

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
1

answered 2014-05-09 22:55:43 +0000

limeyd gravatar image

Why not use i3-msg

bindsym $mod2+1 exec "i3-msg workspace 1 && i3-msg move workspace to output DFP10"

edit flag offensive delete link more

Comments

Most of the times, this is the wrong thing to do. You're in "i3-msg" context already, and opening a shell, to call i3-msg (twice, in this case).

tasinet gravatar imagetasinet ( 2014-12-07 17:46:31 +0000 )edit
1

answered 2013-04-26 23:04:18 +0000

konni gravatar image

updated 2013-04-26 23:04:50 +0000

separate commands by ;

bindsym $mod+1 workspace 1; move workspace to output right

bindsym $mod2+1 workspace 11; move workspace to output left

edit flag offensive delete link more
1

answered 2013-04-27 14:09:17 +0000

Luye gravatar image

updated 2013-04-27 14:19:17 +0000

Thanks, that worked nicely. I'm getting the functionality I was wanting, however workspace 1 and 11 still gets misnamed when I switch away from them despite working as intended.

Not sure if this is a bug or if i messed something up.

# switch to workspace on left monitor
bindsym $mod2+1 workspace 1; move workspace to output DFP10
bindsym $mod2+2 workspace 2; move workspace to output DFP10
bindsym $mod2+3 workspace 3; move workspace to output DFP10
bindsym $mod2+4 workspace 4; move workspace to output DFP10
bindsym $mod2+5 workspace 5; move workspace to output DFP10
bindsym $mod2+6 workspace 6; move workspace to output DFP10
bindsym $mod2+7 workspace 7; move workspace to output DFP10
bindsym $mod2+8 workspace 8; move workspace to output DFP10
bindsym $mod2+9 workspace 9; move workspace to output DFP10
bindsym $mod2+0 workspace 0; move workspace to output DFP10

# switch to workspace on right monitor
bindsym $mod+1 workspace 11; move workspace to output DFP11
bindsym $mod+2 workspace 12; move workspace to output DFP11
bindsym $mod+3 workspace 13; move workspace to output DFP11
bindsym $mod+4 workspace 14; move workspace to output DFP11
bindsym $mod+5 workspace 15; move workspace to output DFP11
bindsym $mod+6 workspace 16; move workspace to output DFP11
bindsym $mod+7 workspace 17; move workspace to output DFP11
bindsym $mod+8 workspace 18; move workspace to output DFP11
bindsym $mod+9 workspace 19; move workspace to output DFP11
bindsym $mod+0 workspace 20; move workspace to output DFP11

EDIT: No sorry, even more bizzare. First workspace on the right monitor is named "1; move workspace to output DFP10". This is with workspace 1 still working as intended on the left monitor. It appears it occurs on alternate key presses i.e pressing Mod1+1 twice will toggle the phantom on and off.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-26 22:24:32 +0000

Seen: 2,570 times

Last updated: May 09 '14