3

I'm trying to start different apps in different workspaces without using classes.

I have already tried the suggestion at start applications on specific workspaces when i3 starts by including in i3/config:

exec --no-startup-id i3-msg 'workspace 1; exec /usr/bin/firefox'
exec --no-startup-id i3-msg 'workspace 2; exec /usr/bin/emacsclient -c'

But it opens both apps in same workspace (1).

How can I open Firefox in workspace 1 and Emacs in workspace 2?

  • Not using classes so If I want to open another instance of the same app in a different workspace I should be able to do it.

Related but no duplicate: Start applications without class attribute on specific workspaces

marcanuy
  • 205

1 Answers1

3

I had a similar issue when first using i3. I found the easiest solution was simply to add in a quick sleep in-between each application. As an example, this is part of my startup commands section of my i3/config:

exec --no-startup-id sh -c 'sleep 1; i3-msg "workspace 10: <icon>"'
exec --no-startup-id "sh -c 'sleep 2; exec gnome-terminal --working-directory=/media/Data/Music -e ranger'"
exec --no-startup-id sh -c 'sleep 3; i3-msg "splitv"'
exec --no-startup-id sh -c 'sleep 4; exec gnome-terminal -e cava'
exec --no-startup-id sh -c 'sleep 5; i3-msg "focus up"; i3-msg "splith"'
exec --no-startup-id sh -c 'sleep 6; i3-msg "workspace 3: <icon>"'

This switches to different workspaces and opens up different applications/terminals.

Try431
  • 547
  • 6
  • 15
  • 1
    I played around with it, and I managed to bring down the sleep time to 0.2. It makes it 5 times faster. Any lower (for me) and you don't get enough time between applications. – Al-Baraa El-Hag Sep 27 '22 at 14:43