Auto startup programs on workspaces

Interested in auto starting programs on particular workspaces logging into i3. ?
Just make sure you use caps for the first letter with WM_CLASS(STRING) or they will all start on workspace ws1.

Autostart programs & workspaces

assign [class="Brave-browser"]  $ws1
for_window [class="Brave-browser"] focus
assign [class="ncmpcpp-ueberzug"] workspace $ws2
for_window [class="ncmpcpp-ueberzug"] focus
assign [class="cava"] workspace $ws2
for_window [class="cava"] focus
assign [class="Geany"]  $ws3
for_window [class=Geany] focus
assign [class="Spacefm"]  $ws3
for_window [class=Spacefm] focus

exec --no-startup-id sleep 1 && brave
exec --no-startup-id sleep 2 && geany
exec --no-startup-id sleep 3 && spacefm
exec --no-startup-id sleep 4 && kitty --class ncmpcpp-ueberzug -e ncmpcpp-ueberzug
exec --no-startup-id sleep 5 && kitty --class cava -e cava

If you are using i3-workspace-names-daemon

assign [class="Brave-browser"] workspace number $ws1
for_window [class="Brave-browser"] focus
assign [class="ncmpcpp-ueberzug"] workspace number $ws2
for_window [class="ncmpcpp-ueberzug"] focus
assign [class="cava"] workspace number $ws2
for_window [class="cava"] focus
assign [class="Geany"] workspace number $ws3
for_window [class=Geany] focus
assign [class="Spacefm"] workspace number $ws3
for_window [class=Spacefm] focus

exec --no-startup-id sleep 1 && brave
exec --no-startup-id sleep 2 && geany
exec --no-startup-id sleep 3 && spacefm
exec --no-startup-id sleep 4 && kitty --class ncmpcpp-ueberzug -e ncmpcpp-ueberzug
exec --no-startup-id sleep 5 && kitty --class cava -e cava
2 Likes

@KoO I like that feature and use it in every WM I can. I actually find dwm the easiest to do it in. Turns out there are a few formats you can use in i3 to accomplish the ‘feat’.

1 Like

You can do it in pretty much every WM (certainly in FVWM 3, not sure about version 2)

@manyroads chroot

Main thing I like about it is you just go back to where you left off. I live manly on geany, browser, spacefm starting to like pcmanfm the more I use it too. And I can’t forget my beloved mpd ncmpcpp.

Thanks for your reply’s.

Fvwm2.x can also start applications on a specified desktop.

And Fvwm takes it a step further since each desktop can be divided into a grid of pages. An application can start on a particular page of a given desktop (StartsOnDesk, StartsOnPage, StartsOnScreen in the Fvwm man page

I do this with Gimp on all the window managers I use; maximize it on it’s own desktop.

1 Like

Indeed, Fvwm is highly configurable.

Is there a particular reason you delay the startup for a number of seconds for each application?

sleep 1 && ..
sleep 2 && .. 
sleep 3 && ..
1 Like

The sleep delay was already part of the autostart so I just left them there, but the programs start almost instantly anyway and I have no reason to remove them, and starting a program using the mod keys you can only start one program at a time anyway. Feel free to change the what ever you wish it up too you.

And by the way I always use the term programs and not apps to me apps are for phones and programs are for computers. Maybe I’m just old fashioned at 63.

1 Like

When I climb stairs, I take one min break at floor 3, 2 mins at floor 4, 3 mins at 5, … etc. :smile:

1 Like

Sure, a few secs don’t make significant difference when the desktop launches.

lol One of my sons said to me recently dad you like and old man these days, I said son the longer I take to get their the slower time goes.

lol, I’m trying to get used to the stange feeling: now you do things slower, but the time flies damn faster. :grinning:

@chroot @KoO speaking of moving along… are those of us who are formerly young supposed to have these discussions in the Old Farts Club??? :slight_smile:

1 Like

lol, no old farts I guess !

1 Like

LOL, didn’t know that thread exists. No, I’m not going there. If I did, it would take me longer to figure this s6/66 thing out.