Ubuntu – How to rotate one monitor and keep Compiz

multiple-monitorsnvidiarotate-monitor

I was able to rotate one out of two monitors while using the latest nVidia driver (290.10 for Linux-x86_64), but the guide calls for using Xinerama which according to some is not compatible with Compiz. True enough, after restarting the rotation works (even in the login screen), but I can't start compiz anymore:

$ compiz --replace --display :0.0 --sm-disable &
compiz (core) - Fatal: No composite extension
Launching fallback window manager
Xlib:  extension "RANDR" missing on display ":0.0".

Is there any way to have all of the following:

  • Compiz effects
  • One rotated monitor
  • Drag windows between monitors

Best Answer

Try xrandr. There is my rotate script for EeePC with external monitor

#!/bin/bash
# usage:
# ./rotate VGA1 right
s=${1:-'LVDS1'}
r=${2:-'left'}
echo $s;

# see `xrandr` for output modes for all screens
case $s in
'LVDS1')
  m='1024x600' #default resolution of EeePC 1005ha
;;
'VGA1')
  m='1024x768' #best resolution for LG FLATRON 795FT Plus which plugged to EeePC
;;
esac

case `xrandr | grep $s | sed 's/^\(.*\+0 \)\(.*\) (.*/\2/g'` in
'left')
  echo 'returning from left to the normal state on screen '$s' with the '$m' mode'
  xrandr --output $s --mode $m --rotate normal
;;
'right')
  echo 'returning from right to the normal state on screen '$s' with the '$m' mode'
  xrandr --output $s --mode $m --rotate normal
;;
*)
  echo 'rotating to the '$r' on screen '$s' with the '$m' mode'
  xrandr --output $s --mode $m --rotate $r
;;
esac
Related Question