I want to power on the computer and have a Bash script to open all my programs in different Gnome work spaces.

For example:

  1. Open text editor and CLI in the first work space.
  2. Open web browser A in second work space.
  3. Open web browser B in third work space.
  4. Open two file managers in fourth work space.

How to achieve that? Any alternative?

Not wishing to hibernate my computer to keep the session, wish to shut down or restart often, and start fresh.

  • Workspaces are a window-manager feature. some WMs are programmable and let you create rules that say things like "when the window title is 'foo', move it to desktop 3". IIRC, gnome isn't one of them. I don't think any programs have command-line options to specify workspace. – cas Apr 30 '16 at 23:14
  • install wmctr and wmctrl -r 'thunderbird' -t 1 – JJoao Apr 30 '16 at 23:18

This isn't via bash, but the GNOME Shell extension Auto Move Windows lets you define rules so that programs are automatically opened on predefined workspaces.

If that doesn't do you what you need, you could consider extending the extension (source here; it's in Javascript) to better fit your specific need.

| improve this answer | |
  • Very close. I will stick with this solution for now and later try wmctr suggested by JJoao. Just missing to manage many instances of the same application. – mikl Apr 30 '16 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.