3

Since Ubuntu has no options to save and restore desktop sessions on shutdown of the computer, I want to write a shell script which helps to setup a customized workspace on a single command. I've found similiar questions on the web. However, I tried gDevilspie and was absolutely lost with that application. Nor do I want to use Compiz as I have made really bad experiences with this software messing up my system several times in the past.

I am looking for a clean an simple shell script which can be called as a command via the Dash. For example, the "office scenario" command would do this:

  • start Atom editor in workspace 1
  • start Terminator in workspace 1
  • start Firefox browser in workspace 3
  • start Slack in workspace 4
  • start Trello (Chromium application shortcut) in workspace 4
  • start Sunrise Calendar (Chromium application shortcut) in workspace 4

Is a shell script the proper way to achieve this goal? If so, what would the shell script need to look like (I have no shell scripting experience so far) and where would it belong to be called as a single command via the Dash?

I appreciate your help very much.

Bunjip
  • 815
  • 1
  • 11
  • 23

1 Answers1

0

Start several applications with one command

Write a shell script:

#! /bin/bash
atom &
terminator &
firefox

Save it as e. g. “myscript”, do chmod a+x myscript and create a shortcut to your start menu (depends on what you're using, just search the web for instructions how to do that).

Open an application in a specific workspace

This is a little bit tricky. Assuming you're using GNOME Shell, try these instructions to bind a .desktop file to a specific workspace. If it works you can define which applications should start where.

Edit: wmctrl is able to send a program to a specific workspace, e. g.

wmctrl -r :ACTIVE: -t 3 # sends the currently active window to workspace 3

You can combine it like

( firefox && wmctrl -r firefox -t 3 ) &
( atom && wmctrl -r atom -t 2 ) &
…
dessert
  • 40,956