screen resolution command

Asked by Ted C

I have an Acer Aspire One D260 net book. It has Ubuntu 10.10 on it.

The screen is 10.1 inch. It's default display is 1024x600 (smaller sizes are available in Gnome display manager).

I need to increase the screen resolution, when needed, to use things like the standard PDF print dialogue to 768 in height and then easily change it back.

Using this command in the terminal increases the height: xrandr --output LVDS1 --mode "1024x600" --scale "1x1.28".

This changes it back to default: xrandr --output LVDS1 --mode "1024x600" --scale "1x1".

Is there a way to store these commands in an 'icon' that can be kept on the bar where the Applications, Places and System menus are ?

Ideally one 'icon' i.e. click once to change resolution and click again to change back.

Thanks for any help offered.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu xorg Edit question
Assignee:
No assignee Edit question
Solved by:
mycae
Solved:
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

If you are using the standard gnome interface, you can just add a launcher to the panel.

Right click somewhere on the panel, then select "custom application launcher", then paste that command in the command box.

Revision history for this message
Best mycae (mycae) said :
#2

Sorry, should have read your question about toggling.

Yes, you can do that too, but you will need a shell script that detects the scaling factor currently in use.

try something like this (I have not tested it). Its a hack, but it might work

== Paste into new text file, then mark as executable===
#!/bin/bash

ASPECT=1.28
#Ask Xrandr for the current transformation line; if it contains the
#aspect ratio we asked for, assume we have set the aspect previously
TRANSFORM=`xrandr --verbose | grep --after-context=3 Transform | grep $ASPECT `

if [ x$TRANSFORM != x"" ] ;
   # We must have selected a 1.28 transformation

   # Reset local display to 1:1 aspect
   xrandr --output LVDS1 --mode "1024x600" --scale "1x1"
else
   # We must have selected some other transformation
   # Reset to 1:1.28 aspect
   xrandr --output LVDS1 --mode "1024x600" --scale 1x$ASPECT
fi

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

You can also add the item to your startup items so it gets ran automagically after you follow mycae's advise.

Revision history for this message
Ted C (tedc) said :
#4

Thanks Players!

I got this working very nicely this morning. Doing this a good break from UK Archives Cabinet documents and stuff from the Bodleian Library - doco's usually PDFs or image files and I need lots of them at the moment. Many handwritten so easy change of screen resolution between reading/printing very time saving.

Ta.

=====================================
#!/bin/bash
#From LaunchPad:Ubuntu:MYCAE 20110416

ASPECT=1.279999
TRANSFORM=`xrandr --verbose | grep --after-context=3 Transform | grep $ASPECT`

if [ "$TRANSFORM" != "" ]
 then xrandr --output LVDS1 --mode "1024x600" --scale "1x1"
 else xrandr --output LVDS1 --mode "1024x600" --scale "1x1.28"
fi
======================================

Revision history for this message
Ted C (tedc) said :
#5

Thanks mycae, that solved my question.