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

Weird startup workspace behavior

asked Feb 26 '14

anonymous user

Anonymous

updated Feb 26 '14

I have this code snippet in my config. It opens up the "Web" workspace just fine, but with the others, they just open up on the same workspace. I'm confused. It seems random on the workspace that the rest of them open on. It's really weird. Did I make a typo that I can't see for the life of me?

#Startup Application on named workspaces
exec i3-msg 'workspace 1:Web ; exec chromium' 
exec i3-msg 'workspace 2:Term ; exec rxvt -rv'
exec i3-msg 'workspace 8:IRC ; exec rxvt -rv -e irssi'
exec i3-msg 'workspace 9:Music ; exec clementine'

Comments

I've bound these exact commands to shortcuts and it works perfectly. Why doesn't it work on startup?

dylan gravatar imagedylan (Feb 26 '14)edit

3 answers

Sort by » oldest newest most voted
0

answered Mar 6 '14

Pinyaka gravatar image

i3 doesn't wait for commands to finish, so if the command doesn't notice which workspace you started the execution from, it will show up on whichever workspace is selected when the window opens.

Comments

This is not entirely correct. i3 does remember on which workspace you started an application and will open the applications windows on that workspace. This requires startup-ids to be supported by that application, though.

Michael gravatar imageMichael (Apr 17 '14)edit
0

answered Mar 7 '14

gunjanthesystem gravatar image

Try this:

exec --no-startup-id i3-msg 'workspace 1:Web ; exec chromium; workspace 2:Term ; exec rxvt -rv;workspace 8:IRC ; exec rxvt -rv -e irssi';workspace 9:Music ; exec clementine'

Comments

1

What’s correct in this answer is the --no-startup-id for running i3-msg itself (since i3-msg is not a GUI application). But why would concatening all the commands together be any different than what the original poster does?

Michael gravatar imageMichael (Apr 17 '14)edit
0

answered Mar 15 '14

joepd gravatar image

updated Mar 15 '14

Why it does not work? Race conditions that might be circumvented by the --no-startup-id-flag for applications that support it.

How to make it work? for_window.

Comments

Note that using for_window in this case is a hack and should not be necessary. Instead, the proper solution is to make rxvt (and perhaps clementine?) support startup ids. I know that in urxvt, they work (I implemented them there ;)).

Michael gravatar imageMichael (Apr 17 '14)edit

Question Tools

Stats

Asked: Feb 26 '14

Seen: 382 times

Last updated: Mar 15 '14