5

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

1

2 Answers 2

3

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

1
  • 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, 2011 at 2:37
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .