i3

In i3wm how can I open programs on another workspace at startup?


I've tried multiple ways in my config file to get chromium to open on $ws2 but it just keeps opening on $ws1 on startup.


Solution

  • First you have to find the WM_CLASS(STRING) from xprop. Open xprop and click on the target window you'll see the information about that window. Find WM_CLASS(STRING) second string(for i3wm) then goto the config file of i3 wm .config/i3/config and define the rule like this for_window [class="Chromium"] move to workspace $ws2 for_window [class="TelegramDesktop"] move to workspace $ws3 Here replace the class="String" with the string we found before with xprop. enter image description here

    enter image description here

    Alternatively, follow the instructions in section 4.17 of the i3 User’s Guide and insert into your config file an assign declaration e.g. assign [class="Chromium"] $ws2. This will open the program directly on the specified workspace. For less well behaved programs like Spotify the for_window ... move to workspace ... method is required to move the program after it has opened, however.