1 Using workspace toogle under Gnome with Compiz
While gnome lacks in a command to toggle or rotate through workspaces at all, there seem to be several solutions for Gnome without Compiz using the wmctrl tool. As iam using Gnome with Compiz (normal or extra doenst matter), you can`t switch the workspaces the same way.
You alway will have one workspace when trying "wmctrl -d" and so you can switch the workspace to the next one using "wmctrl -s NUMBER". The solution is to move the viewport instead. As i did not find this solution in the web at all, i thought about writing it down here.
So what we do i creating a workspace toggle (or rotate) for switching to the next workspace on the horizontal direction by using a keyboard or mouse shortcut. When we reach the last workspace, we switch back to the first one. When you have 2 workspaces, this toggle becomes extremly useful.
1.1 wmctrl
First of we need to install a small tool. Its included in the reporsitories, so simply use aptitude
sudo aptitude install wmctrl
1.2 Script
First of you need to create a script with the following content. You can place it in ~/bin/togglews in example
mkdir ~/bin
touch ~/bin/togglews && chmod u+x ~/bin/togglews
vim ~/bin/togglews
Now past this content inside
#!/bin/bash
viewport=`wmctrl -d | awk -F" " '{ print $6}' | awk -F"," '{print $1}'`
geom=`wmctrl -d | awk -F" " '{ print $4}' | awk -F"x" '{print $1}'`
workspaceWidth=`wmctrl -d | awk -F" " '{ print $9}' | awk -F"x" '{print $1}'`if (( $viewport + $workspaceWidth < $geom )); then
wmctrl -o $(($viewport+$workspaceWidth)),0
else
wmctrl -o 0,0
fi
1.3 Shortcut
Now our last step is to finally create a shortcut
gconf-editor
Now go down to the apps -> metacity -> global_keybindings and enter a shortcut for the run_command_1. To find out, what value a specific shortcut could have ( like mine special XF86Back ) use the System -> Settings -> Shortcut Dialog and just try it there.

Now go down to keybinding_commands and change the value for comand_1 to /home/<USER>/bin/togglews

Now close the editor.
Your done. Now you can use the shortcut to toggle(rotate) through your workspaces.
1.4 Devilspie
Be sure to check this small tool included in the ubuntu reporsitories. It lets you define simple rules so that applikations always apear on the same workspace, with the same position and size. Extremly handy
sudo aptitude install devilspie
Look here to see some examples





This is not the same at all.
This is not the same at all. Everybody is aware of those "left and right" shortcuts - but this is not what people want. They want to cycle / toggle trough there desktops using one button.
From the usability aspect this makes a huge difference.
All this is unnecessary with
All this is unnecessary with Compiz. Compiz already has viewport switching capability inbuilt. This is by default bound to Ctr-Alt-Right/Left. I just rebind it to a single key (XF86Back and XF86Forward on my Thinkpad) through CompizConfig Settings Manager.
Kommentar hinzufügen