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

Setting layouts upon i3 launch

asked Jul 13 '12

0x000000 gravatar image

Arch Linux, i3 4.2-2.

The last line of my i3 config file is

exec_always i3-init

Where i3-init is the following shell script:

#!/bin/bash

tabbed=( 1 4 6 7 )

for w in $tabbed; do
    i3-msg "workspace $w; layout tabbed"
done

i3-msg "workspace 1"

So on workspaces 1, 4, 6, and 7, set the tabbed layout. The problem is that the layout isn't actually set when this script is run unless there are windows on the workspace, so I either have to set the layout manually or restart i3 after the windows exist. Am I doing this wrong or is this a limitation?

2 answers

Sort by » oldest newest most voted
0

answered Jul 13 '12

Michael gravatar image

updated Oct 11 '15

You can’t do it this way. Workspaces are destroyed when you switch away from them (and that’s not going to change). Instead, have a look at this ticket: https://github.com/i3/i3/issues/581

Comments

Right on, I didn't realize the workspaces were destroyed. Thanks for the link.

0x000000 gravatar image0x000000 (Jul 13 '12)edit
0

answered Jan 26 '13

What about working around by adding extra commands to your workspace switch key?

workspace_layout tabbed
bindsym $mod+2 workspace 2; layout default
bindsym $mod+3 workspace 3; layout default
...

Question Tools

1 follower

Stats

Asked: Jul 13 '12

Seen: 4,369 times

Last updated: Oct 11