Quoting unman from another thread:
You can also make this with i3wm, but I think this conversation deserves its own thread as there may be other (even better) ways to do it.
For complex configurations like these, using a configuration management engine like SaltSack may be a better bet – and Qubes is integrated with SaltStack (but It’s quite different from Bash scripts). In case you haven’t come across it, take a look here:
This will make your life easier (in the long run) thanks to the increase maintainability.
Bash scripts often break because you changed a tiny thing manually on your setup. Whereas with salt you instead of describing the steps to achieve your desired config (imperative) you describe how your desired config looks like (declarative). So if something changes in the path to get to your desired state, salt will manage that for you.