Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use several workspaces in order to have different context for different works. Therefore, I run the same set of applications in the same workspace repeatedly. And also I run the same application in each set of applications, so setting the default workspace where each application should run doesn't work for this purpose.

For instance:

  • Workspace1: 1 terminal + 2 tabs opened in Chrome + a document opened with PDF Viewer
  • Workspace2: 3 terminals + 4 tabs opened in Chrome + 1 tab opened in Firefox + Eclipse

So, is there any way to have a script or something like set_workspace1.sh that once run open all the desired programs in a specific workspace?

BTW, I'm running 11.04

share|improve this question

I don't think that there's such a function for the standard window manager.

But Devil's Pie can do what you want.

http://burtonini.com/blog/computers/devilspie/

Quote from Devil's Pie website: "Devil's Pie can be configured to detect windows as they are created, and match the window to a set of rules. If the window matches the rules, it can perform a series of actions on that window. For example, I can make all windows created by X-Chat appear on all workspaces, and the main Gkrellm1 window does not appear in the pager or task list."

I hope this helped you,

Daniel

share|improve this answer
    
Thanks for your answer Daniel, but I don't think that Devil's Pie can do the work. I think that I simply (hopefully) need to create some customized scripts to run each program and positionate it in the correct workspace. – Andres Apr 13 '11 at 2:37

Technically speaking workspaces are referred to as viewports , a specific section of the extended desktop, with specific coordinates, for instance 0, 0 is the viewport 1 and 1366, 0 would be the one immediately to the right.

It should be noted that CompizConfig Settings Manager has an option for "fixed" opening of a window on specific workspace, but one can create a script like you've mentioned. Here's my example.

#!/bin/bash
get_viewport()
{
  xprop -root -notype _NET_DESKTOP_VIEWPORT | awk '{print $3,$4}' 
}

spawn_viewport_1()
{
  nohup gnome-terminal 2>&1   > /dev/null  &
  nohup chromium-browser 2>&1 > /dev/null  &
}

spawn_viewport_2()
{
 nohup xterm 2>&1 > /dev/null  &
  nohup firefox 2>&1 > /dev/null  &
}

main()
{
  case $(get_viewport) in
   "0, 0") spawn_viewport_1  ;; # note , single space in "0, 0" is important
   "1366, 0") spawn_viewport_2    ;;
  esac
}

main

Essentially what is happening is that I've got two functions, each for specific viewport. I also have a function that checks what viewport I am currently on. If I am currently on viewport 1 (coordinates 0,0) it will spawn one set of apps. If I am on viewport 2 (coordinates 1366,0), we will have different set of apps spawned.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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