Navigatrix.net - A Voyager's Companion
http://navigatrix.net/

Updated Netbook Screen Resolution
http://navigatrix.net/viewtopic.php?f=10&t=363
Page 1 of 1

Author:  Moe [ 06 Feb 2013, 18:53 ]
Post subject:  Updated Netbook Screen Resolution

If you run a netbook machine like me, you will find the screen resolution options ...um...ah, lacking.

My 'normal' choices are 1024x600; 800x600; or 640x480.

I honestly can't find a reason to use the last two options. I frequently find a need for more real estate with 1280x800 or even the eye squinting 1440x900.

However, if you upgrade to the latest X11 version traditional scaling breaks and the cursor is imprisoned within the confines of your 'normal choices'.

A script was written to deal with this new reality, but sometimes I'm just a point 'n' click sort of guy and so I modified it to suit me.

Give it a whirl; open the terminal:

make a local bin directory if you don't already have one:

mkdir bin

Create the script and Desktop Shortcut:

gedit bin/nxrez Desktop/alilbigger.desktop

Into the first file paste:
Code:
#!/bin/bash

# Marc Brumlik, Tailored Software Inc, [email protected]
# Wed Jan  2 05:23:54 CST 2013

# newrez v 1.0
# use xrandr to scale the display to a new resolution
# rewriten to handle mouse boundaries when scaled
# this requires setting a new resolution to the unused VGA1 device
# then scaling that for B display on the LVDS1 device
# modified by Moe because he's lazy and doesn't like to type.

umask 000

# resolution can optionally be specified on command line
newrez=$1

# we MUST be running xrandr 1.3 or higher
if xrandr -v | grep "RandR version 1.[012]"
   then   zenity --info --title="XRandR version is too old" --text="You must be running Xrandr
version 1.3 or newer!
Time to upgrade your system  :-)"
      exit 0
fi

# find the currently connected devices, make a list
devices=`xrandr -q | grep connected | grep -v disconnected | cut -d"(" -f1`

# there MUST be a "connected" LVDS1 and a "disconnected" VGA1
current=`xrandr -q`

if echo "$current" | grep "LVDS1 connected" >/dev/null
   then   : OK
   else   zenity --info --title="PROBLEM" --text="Current display must be LVDS1"; exit 0
fi
if echo "$current" | grep "VGA1 disconnected" >/dev/null
   then   : OK
   else   zenity --info --title="IMPORTANT" --text="The VGA1 display resolution may be affected by this change"
fi

default=`echo "$current" | grep -A 1 "^LVDS1" | tail -1 | awk '{print $1}'`
H=`echo $default | cut -d'x' -f1`
V=`echo $default | cut -d'x' -f2`
HZ=`echo $default | awk '{print $2}' | tr -d '[*+]'`

# echo DEFAULT: $default $H $V

  title="Resolutions"
  text="Default Resolution: $default"


if [ -z "$newrez" ]
   then   while true
      do
         newrez=$(zenity --title="$title" --list \
            --height=250 --width 250 --text="$text" \
            --radiolist --column="X" --hide-column=2 --column="Resolution" --column="Screen Size" \
            TRUE    default     Default \
            FALSE   1280x800    "1280 X 800 -- 125%" \
            FALSE   1440x900    "1440 X 900 -- 140%" )
#           additional settings can be added here
#           changing the above ")" to a "\"
#           with the last one in the list ending with ")"
#           For example:
#           FALSE   1440x900    "1440 X 900 -- 140%" \
#           FALSE   4096x2400   "4096 X 2400 Maximum" )
         case $newrez in
            default|[0-9]*x[0-9]*)   break ;;
         esac
            exit 0
      done
fi

case $newrez in
   default)   xrandr --output VGA1 --auto --output LVDS1 --auto
         xrandr --output LVDS1 --mode $default --scale 1x1
         exit 0 ;;
esac

newH=`echo $newrez | cut -d'x' -f1`
newV=`echo $newrez | cut -d'x' -f2`
modeline=`cvt $newH $newV $HZ | grep Modeline`
newmode=`echo "$modeline" | sed 's/^.*"//'`
cvtrez=`echo "$modeline" | sed -e 's/_.*//' -e 's/^.*"//'`

if [ "$newrez" != "$cvtrez" ]
   then   newrez=$cvtrez
      newH=`echo $newrez | cut -d'x' -f1`
      newV=`echo $newrez | cut -d'x' -f2`
fi

scaleH=`echo -e "scale=10\n$newH / $H\nquit" | bc`
scaleV=`echo -e "scale=10\n$newV / $V\nquit" | bc`

if echo "$current" | grep -A 100 "^VGA1" | grep $newrez >/dev/null
   then   : already there
   else   xrandr --newmode "$newrez" $newmode
      xrandr --addmode VGA1 $newrez
fi

if xrandr --output VGA1 --mode $newrez --output LVDS1 --fb $newrez --scale $scaleH"x"$scaleV 2>&1 | tee -a /tmp/xrandr.err
   then   : success
   else   zenity --info --title="Xrandr produced this error" --text="`cat /tmp/xrandr.err`"

The problem could be that Your video driver
does not support xrandr version 1.3
      rm -f /tmp/xrandr.err
fi


Into the second empty file paste:
Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=A lil bigger screen
Comment=Change screen resolution for a large/smaller desktop
Exec= ./bin/nxrez
Icon=preferences-desktop-theme.png
Terminal=false
Type=Application
Categories=Settings;


Save both files and exit the text editor.

Make the script executable:

chmod +x bin/nxrez

If you want a menu option in Preferences....
sudo cp Desktop/alilbigger.desktop /usr/share/applications/

...and test drive.

Author:  David [ 09 Aug 2013, 00:28 ]
Post subject:  Re: Updated Netbook Screen Resolution

I never got this one to run .... but maybe its because i am using the external screen on a desktop computer.

Author:  Moe [ 09 Aug 2013, 00:39 ]
Post subject:  Re: Updated Netbook Screen Resolution

The external monitor I use for the boat is pretty basic and I can't control the backlight, and Redshit/Nightshift can't control it either. But it does have brightness button on the front...and it is 19 inches.

Code:
wadda@Baboo:~$ xrandr --prop
Screen 0: minimum 320 x 200, current 1440 x 900, maximum 32767 x 32767
LVDS1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 223mm x 125mm
   EDID:
      00ffffffffffff004ca34e5500000000
      0012010380160d780a859599574f8f26
      21505400000001010101010101010101
      010101010101f8160094415856201888
      3600df7d000000190000000f00000000
      00000000001eb4027400000000fe0053
      414d53554e470a2020202020000000fe
      003130314e5430322d4130340a2000ad
   BACKLIGHT: 9 (0x00000009)   range:  (0,9)
   Backlight: 9 (0x00000009)   range:  (0,9)
   scaling mode:   Full aspect
      supported: None         Full         Center       Full aspect
   1024x600       60.0*+
   800x600        60.3     56.2 
   640x480        59.9 
VGA1 disconnected 1440x900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1280x800       59.8 
   1440x900       59.9*
wadda@Baboo:~$
as you see the script also has to control the proper video output as well. It might have to be altered for the other output.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/