Ubuntu – Screen resolution repositioning? (Broken laptop screen)

laptopresolutionscreen

I have a laptop with the top left corner's screen being broken – I can't see anything there. However it's just a small corner, so I'd like to know if there's something I can do to make Ubuntu not use that part of the screen at all – I basically want it to ignore 2 unity taskbars on the left, and re-position all the content.

Best Answer

Create a script @ let's say /usr/share/screen.sh

sudo touch /usr/share/screen.sh

make it executable

sudo chmod a+x /usr/share/screen.sh

edit the file (I will use gedit here, so it is easier to paste for newbies)

gksu gedit /usr/share/screen.sh

paste the contents of this script:

#!/bin/bash

#change these 4 variables accordingly
ORIG_X=1280
ORIG_Y=800
NEW_X=1160
NEW_Y=800
###

X_DIFF=$(($NEW_X - $ORIG_X))
Y_DIFF=$(($NEW_Y - $ORIG_Y))

ORIG_RES="$ORIG_X"x"$ORIG_Y"
NEW_RES="$NEW_X"x"$NEW_Y"

ACTIVEOUTPUT=$(xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/")
MODELINE=$(cvt $NEW_X $NEW_Y | grep Modeline | cut -d' ' -f3-)

xrandr --newmode $NEW_RES $MODELINE
xrandr --addmode $ACTIVEOUTPUT $NEW_RES
xrandr --output $ACTIVEOUTPUT --fb $NEW_RES --panning $NEW_RES --mode $NEW_RES
xrandr --fb $NEW_RES --output $ACTIVEOUTPUT --mode $ORIG_RES --transform 1,0,$X_DIFF,0,1,$Y_DIFF,0,0,1

Edit the first four lines to your required resolution. I have experimented with 1280x800 as my original one and I took a 120 pixels of the horizontal part as the unity bar is about 60 pixels wide. Save file and exit gedit.

Fallow these guidelines - How do I start applications automatically on login - to create a startup script. Put a Screen resize or something like that in the Name field and /usr/share/screen.sh as the Command

Restart Ubuntu and hopefully you will get what you want. It works on my machine :)

Related Question