I am not sure how I am supposed to automate such delicate tasks on my daily routine. Let me describe it:

  • open Sublime Text in first desktop
  • open Chrome in second
  • open two terminal windows in third, align them vertically and run a set of different command on each
  • open terminal window in fourth screen

I am efficient handling this manually quickly but some days I just have to restart my box a few times and would like to have some script which would automate the task.

My question may consist of several parts:

  • How do I imitate keystrokes(move to align windows)
  • How do I open multiple terminal windows
  • MOST important - what kind of tool to use? I hope I am able to do that with Bash but I am not very efficient with it.

2 Answers 2


For always placing certain windows on certain desktops, I recommend Compiz's Place Windows plugin. It lets you assign windows to desktops based on window name or class.

To access compiz settings, install the settings manager:

sudo apt-get install compizconfig-settings-manager
  1. Now run command "ccsm". This'll open advanced settings for the Compiz window manager (don't worry, the settings manager is clear enough that you won't screw up your system unless you're really trying ;).
  2. Just scroll down or search for "Place windows".
  3. Go to tab "Fixed Window Placement". Under "Windows with fixed viewport", click "new".
  4. Add a new window to the set by clicking the plus sign.
  5. You can select a window based on class (which application it belongs to), role (which window of a certain application), etc.. You can play around with this until you get a feel for it. To fill in the value, use grab and click the crosshairs on the window you want to select. I've found that grabbing a window title doesn't work, but you can always fill it in by hand.
  6. When you have the window you want, fill in the X and Y coordinates of the desktop to assign it to. Voilá! The window will not open on that desktop by default (but you can still move it after it's been opened).

Having certain applications launch at startup is even simpler: just open unity and search for "Startup Applications". Here you can add every application that you want launched after you login.

Note: depending on how fast your application launches at startup, it may launch before Compiz is ready, in which case it will not be placed on its assigned desktop, but on the first desktop instead. I've been looking for a solution to this myself. Maybe it's as simple as using "sleep 3 && /usr/bin/myapp" instead of "/usr/bin/myapp".

  • Well Thanks for an advice! :) I will try it probably tomorrow and report back how it went Nov 10, 2013 at 20:16

By the way: if you're into productivity and automation, you might like easystroke and guake. The former lets you launch applications using mouse gestures, the latter gives you a terminal that you can quickly access from any desktop with a hotkey.

  • This should be a comment not a separate answer :) but thanks! I use quake. It's really cool! but haven't heared about easystroke! Nov 10, 2013 at 20:56

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.