Sunday, November 15, 2009

How to enable compiz on multiple display (adding my ubuntu forum post)

For multiple monitor setups, here's the trick to get the compiz,

Check the GL_MAX_TEXTURE_SIZE using
Code:
glxinfo -l | grep GL_MAX_TEXTURE_SIZE
Mine was 2048, Now we want a horizontal resolution higher than 2048 in compiz. We can just tell compiz to ignore this limitation. BUt I did it the dirty way by changing /usr/bin/compiz script:

Code:
sudo vi /usr/bin/compiz
Here I commented the line, TEXTURE_LIMIT=.... and added TEXTURE_LIMIT=2944.

Now enable compiz with Appearance settings in ubuntu. The wallpaper will be redrawn, Hence we must enable wallpaper compiz plugin from CCSM (compizconfig setting manager).

But to enable wallpaper plugin we must disable nautilus desktop from gconf editor. I used this trick from tombuntu:

Code:
Launch the Run Application dialog with Alt-F2
and run gconf-editor.
Navigate to apps->nautilus->preferences
and unselect the show_desktop option.
Your desktop icons should disappear.
Now enable the wallpaper plugin from CCSM

Now just add the lines as commands to compiz and enjoy

My setup is

Code:
[TV connected to laptop via VGA]
__________ ___________
|1024x768| |1920x1080|
| laptop |---->| display |
|________| |_________|
/________/
win+1 --> move to laptop display
Code:
bash -c "wmctrl -r :ACTIVE: -b remove,maximized_horz && wmctrl -r
:ACTIVE: -b remove,maximized_vert ;wmctrl -r :ACTIVE: -e 0,0,0,1024,768"
win+2 --> move to VGA left half display (external monitor)
Code:
bash -c "wmctrl -r :ACTIVE: -b remove,maximized_horz && wmctrl -r
:ACTIVE: -b remove,maximized_vert ;wmctrl -r :ACTIVE: -e 0,1025,0,960,1080"
win+3 --> move to VGA right half display (external monitor)
Code:
bash -c "wmctrl -r :ACTIVE: -b remove,maximized_horz && wmctrl -r
:ACTIVE: -b remove,maximized_vert ;wmctrl -r :ACTIVE: -e 0,1985,0,960,1080"

want win+3 --> restore to original pos (does not work sometimes)
Code:
bash -c "wmctrl -r :ACTIVE: -b toggle,maximized_vert && wmctrl -r
:ACTIVE: -b toggle,maximized_horz;"

No comments:

Post a Comment