Friday, April 2, 2010

Panning screen at 1024x768

Sometimes I encountered the problem that I had a dialog on the screen which was too large for the display's native 1024x600 resolution. In windows the EeePC tools offer a panning mode that switches to a virtual 1024x768 resolution where the visible section of the screen follows the mouse pointer. So I thought it must be possible to do the same with xrandr. Some playing around with xrandr was a success. Searching for solutions of others led me to a convenience script:

#!/bin/bash

function pan-mode {
echo `xrandr --prop | grep "current"`
}

function pan-enable {
echo Enabling VGA output
xrandr --output LVDS1 --panning 1024x768
}
function pan-disable {
echo Disabling VGA output
xrandr --output LVDS1 --panning 1024x600
}

### MAIN ###
case $1 in 
on)  pan-enable ;;
off) pan-disable ;;
status)  pan-mode ;;
*)   echo "*usage: $0 on|off|status"    ;;
esac
Create an executable shell script in the bin dir:
  1. gedit ~/bin/panning (then paste the script into the file and save)
  2. chmod a+x ~/bin/panning
Now you can switch with panning on or panning off in the console.


If you want to make the panning default create or edit the file ~/.xprofile and add the following line to it:
xrandr --output LVDS1 --panning 1024x768
Next time you reboot or restart X the screen will be in panning mode.

5 comments:

  1. Hi Olaf,

    Just wanted to say thanks for setting up this Blog, it's been invaluable since my new 1001p arrived. I now have Netbook Edition Lucid running nicely. Keep up the good work!

    ReplyDelete
  2. just another solution:
    hold the [Alt] Button an then drag the window which is too large for the screen :D

    eine andere lösung:
    [Alt]-Taste gedrückt halten und per drag&drop das fenster verschieben :D

    danke für den blog... jetzt läuft der 1001p perfekt :D mit Lubuntu 10.04 :DD

    ReplyDelete
  3. About two weeks ago i can put this script to work on my eeepc 701 with lubuntu, and i remember that to put it on i dont use exactly what the post said.

    Then i unistall lubuntu and reinstall windows xp, but now i comeback to lubuntu with new version 10.10 but now i cant to start the script.

    So, could you explain more about the starting process of the script, because the "panning on" dont work for me. Please help me because it is a really useful script.

    ReplyDelete
  4. You are a life saver, i have been working on this for sometime, Thank you

    ReplyDelete
  5. xrandr --output LVDS1 --mode 1024x600 --scale 1.00x1.28 --panning 1024x768

    ReplyDelete