JLErvin / berry

:strawberry: A healthy, byte-sized window manager
MIT License
1.01k stars 47 forks source link

Any way to dynamically change the workspace number? #210

Open d00bay opened 1 week ago

d00bay commented 1 week ago

I've been using berrywm on my desktop computer which I built from src. I wanted to have 4 workspaces, I've simply changed WORKSPACE_NUMBER to 4.

I was wondering if there was a way to use berryc in autostart to change in at runtime?

If not, how big an effort would this be?

JLErvin commented 1 week ago

It's not super easy to change since the project makes pretty liberal usage of arrays to index workspaces. For instance, this is the list of all windows grouped by workspace: https://github.com/JLErvin/berry/blob/c66590292dcd41ca2d9f8083d717093cff97eb15/wm.c#L30

That being said, is there any reason to not just set the number much higher than you need? You can easily allocate 10 workspaces at compile-time and only use as many as you need. And if you find yourself needing more they will always be there.