newrez - Increase Screen Rez For Netbook

Nautilus Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

7
8.1
Description:

Newrez is a nautilus script that not only makes it easy to change screen resolution on the fly, it lets you specify a resolution higher than your display's physical dimensions! This means that a netbook with a screen that's 1024x600 can display a scaled 1280x800 or higher (limited only by your eyesight :-)

Newrez does NOT "over-drive" the actual hardware. Instead, it defines a higher-resolution display on the netbook's VGA port, and scales it to the LCD.

You are not restricted to "standard" resolutions. Values like 1100x730 or 1350x900 or even 1400x700 will work just fine (and a few-pixel adjustment automatically applied if needed). Setting to 'default' will return everything back to normal.

Newrez can also be run directly from the command line, as in "newrez 1280x800" or "newrez default". This makes it a simple matter to switch to create scripts or icons that set your most common resolutions, or to include resolution changes into other scripts or launchers.

REQUIRES:
xrandr (version 1.3 or higher)
zenity
bc
cvt

At present, this will not work if you use the vendor-supplied Nvidia or ATI driver.

If the laptop lid is closed and re-opened, you MAY find the the mouse is constrained to an area the size of the default resolution. This is caused by xrandr. Re-execute newrez to fix this.
Last changelog:

7 years ago

Check my other scripts, too!
(VOTE!!)


0.1 - initial version
0.2 - minor cosmetic fix for older zenity versions
0.3 - when run, the "xrandr" command is saved in a 1-line script ~/newrez-devname-XXXX
0.4 - corrected parsing when multiple monitors are detected
0.5 - a gnome-panel launcher icon can be created automatically
0.6 - better panel icon creation
0.7 - much more thorough testing to ensure proper versions of xrandr and gnome-panel-add
0.8 - Added "newrez-v" which is an entirely different approach to compensate for "constrained mouse" issue in latest xrandr. newrez-v starts a vncserver at a higher resolution and then starts a vncviewer in scaled mode. Not as elegant, not as fast, but will work on ALL systems.

0.9 is a rewrite, and avoids the problems of a confined mouse by defining new resolutions to the VGA output, then scaling for display on the LCD. It's been tested in gnome2 and gnome3 as well as the MATE and Cinnamon desktops.

1.1 fixed issue when returning to "default" resolution, where mouse was not confined to screen edges.

qkzoo

10 years ago

Hello, I'm fairly new to Ubuntu. I tried this script, and it didn't seem to do anything. I'm using a netbook with a maximum resolution of 1024 x 600. I played with it a little and finally got somewhere when I typed in something ridiculous, like 2100. That brought the resolution to 2048 x 1200 (2 x 2).

For some reason this script doesn't affect the ratio unless it's greater than 2048, am I mistaken?

I created a couple of the shortcuts and manually changed the ratios, and finally got it working. Perhaps I'm a moron, but what is the math to figure out the ratio?

These are the ones I got working:

1024 x 600 (1 x 1)
1280 x 800 (? x ?)
1497 x 936 (1.17 x 1.17)
1600 x 1000 (1.25 x 1.25)
2048 x 1200 (2 x 2)

What is the ratio for the 1280 x 800? I gathered the above numbers from browsing this thread.

Thanks

Report

C

marc41

10 years ago

Hi! Hope I can help...

The ratios themselves are simply the 'desired' horizontal resolution divided by the 'default' (usually the 'hardware') horizontal resolution. So they ought to be: 1280=1.25 1497=1.46 1600=1.56, etc.

The script simply takes your 'desired' rez, divides it by 'default' to get the ratio, constructs the "xrandr" command line, and puts it into a script and an icon for later use.

Calculation of the ratio depends on the linux program "bc". If the script is producing a "scale" value of "1" for all your shortcuts until you reached 2048 and then jumped to "2", it would seem that the results of dividing 'desired' by 'default' are always producing integer values.

To test this, go to a command prompt and type "bc<enter>". Then type "scale=2<enter>1600/1024<enter>quit<enter>". You should have gotten an answer of "1.56"

Keep me posted...

-- Marc

Report

C

marc41

10 years ago

Hi! Hope I can help...

The ratios themselves are simply the 'desired' horizontal resolution divided by the 'default' (usually the 'hardware') horizontal resolution. So they ought to be: 1280=1.25 1497=1.46 1600=1.56, etc.

The script simply takes your 'desired' rez, divides it by 'default' to get the ratio, constructs the "xrandr" command line, and puts it into a script and an icon for later use.

Calculation of the ratio depends on the linux program "bc". If the script is producing a "scale" value of "1" for all your shortcuts until you reached 2048 and then jumped to "2", it would seem that the results of dividing 'desired' by 'default' are always producing integer values.

To test this, go to a command prompt and type "bc<enter>". Then type "scale=2<enter>1600/1024<enter>quit<enter>". You should have gotten an answer of "1.56"

Keep me posted...

-- Marc

Report

Karmicbastler

10 years ago

hi dear,

I just have one question: here in my Notebook, I have an nvida-graphiccard. So I would like to konw, if your little script also works with these graphiccards?

Thanks for your answer.

Greetings
Karmicbastler

Report

C

marc41

10 years ago

The newrez script will work with all hardware, including the Nvidia and ATI cards. However, the driver for that card must support "xrandr version 1.3".

Most of the standard drivers on a reasonably recent Linux install do support version 1.3 with the exception of drivers for very old cards.

For the ATI and Nvidia cards, more than one driver is available. In the case of Nvidia, your choices are 'vesa' (low performance). 'nouveau' (good performance with acceleration), and 'nvidia' (a "non-free" driver written by the vendor, and potentially the best performer).

The 'nvidia' driver is installed by many users because it offers the best performance and the most features. However, this driver does NOT support version 1.3 of xrandr. Therefore if you are using the kmod-nvidia package then newrez will not work. Perhaps some day this driver will be updated to support 1.3.

Until then, if one of the other drivers for your card is suitable for your performance needs, then newrez will work fine.

Report

davromaniak

10 years ago

Hi.

While reading you script, I see some glitches that might be source of problems.

On line 13, why not extracting the version, and comparing it with '1.3'.

For example :
version=$(xrandr -v | sed 's/^.*RandR version \([0-9]\.[0-9]*\)/\1/')
if [ $version -lt '1.3' ]
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

On line 92, you are using the locate command for finding the full path to a binary, but there a command called "which", which return the full path to an executable binary.

And which returns 1 when the command is not found.

In your case, with locate, if I have a non binary gnome-panel-add file in any directory, it will try to call it.

Here is a little example on how to use which in your script.

Example :
which gnome-panel-add || (echo "Command gnome-panel-add not found"; exit 1)
paneladd=$(which gnome-panel-add)
$paneladd --launcher=~/newrez-$newrez.desktop --right-stick

I hope this will help you making this script better.

Thanks.

Report

C

marc41

10 years ago

Hi -- I appreciate the suggestions. Here is WHY I did WHAT I did:

When testing for the xrandr version, I know that 1.1 and 1.2 will not work. I Also know that 1.3 and the current version 1.3.3 do work. And I expect that future versions also work. Your suggestion is reasonable, but the "test" command numerical evaluations are integer-only. I considered taking "1.3" and "the installed version", removing the "."'s. padding both with enough trailing zeroes to be of equal length, and then using the test you describe. It just seemed like more work than necessary.

When looking for the gnome-panel-add binary I found that does not live in $PATH (at least on my Fedora system). Therefore, neither "whereis" nor "which" will can be used. This leaves me with three options: to assume that it is in the same place on all distributions (scary), to hunt it down with "find" (guaranteed to work but slow), or to use "locate" (and assume that the distro is running the "mlocate/updatedb" cron job). I felt it unlikely that there would be another file by that name, but perhaps it WOULD be smart to ensure that exactly one match was found (I will DEFINITELY do that). If you have other ideas for this issue, I'm totally open.

Thanks to your input, I've just found that gnome-panel-add is rather new. On my Fedora 11 system that binary does not exist, but on 12 and newer it does. To further complicate things, on the newer versions (Fedora 14), "gnome-panel --version" returns an error. UGH! I've added code to do some testing to ensure that only one gnome-panel-add exists, that it is a python script, and that it is a new enough version.

I appreciate the input! Try version 0.7

THANKS!

Report

Cooleech

10 years ago

Well, which returns messages in other languages than english, you know.. I'd rather use type -p instead.

Report

davromaniak

10 years ago

Yes, "which" is localized, but here, I only use the return code (the exit status).

Taken from the manpage :

0 : if all specified commands are found and executable
1 : if one or more specified commands is nonexistent or not executable
2 : if an invalid option is specified
mething

And when which doesn't find any pathname, it prints nothing and exits with status 1.

Thanks.

Report

Cooleech

10 years ago

I tried both 0.5 and 0.6, and both fail to do anything but short flicker on the screen. Ubuntu Lucid, ATI HD3230.

Report

Cooleech

10 years ago

Oh, yes.. and driver is "default" from Lucid, not an non-free one.

Report

Cooleech

10 years ago

I will if you promise you'll try my script version 3.9.1 once I get it online (in day or two)! :D ;)

Report

C

marc41

10 years ago

HAHA!! It's a deal :-)

You could also check out my "Audio/Video Convert" script -- put a lot of work into that one...

Report

Cooleech

10 years ago

There's this program for M$ windows called Super(r) which is great tool for converting videos and audios, and I want to have similar nautilus script. I'll check your script, and if there's no need to improve anything (which would be great, since I am a bit lazy, lol ;)), I won't bother making such script myself. :)

Report

aubade

10 years ago

It's really nice to have a gui to access Xrandr's scale, but out of curiosity, why a Nautilus Script? This sort of thing strikes me as the sort of thing that would make more sense as a hack to gnome's Monitors capplet, or a panel applet.

Report

C

marc41

10 years ago

I suppose this could have been implemented somewhere else within the system. It started out at the command line as an experiment, and evolved into a bash script due to the math required to compute the scaling for an arbitrary resolution (scaling is based on the ratio of desired resolution to maximum hardware resolution). As a shell script, it was natural to just use zenity to GUIfy the interface.

From concept to posting, newrez was about two hours of work. I've done a bit more to it since then, and have considered that implementing the mode changes could be done elsewhere. Writing one-line files to /tmp that can be inserted elsewhere was a step in that direction. These files are specific to the native display resolution and the arbitrary resolution input by the user. A complete set of all possibilities would be quite large.

It seems that xorg.conf style mode lines cannot include the 'scale' arguments. The 1-line scripts can be used in /etc/X11/xinit/xinitrc.d and possibly elsewhere, but this requires a bit of user intervention. Referencing a script in Startup-Applications seemed a reasonably friendly "automation" that any user could handle.

And a big consideration is that this needs to work on a variety of distributions and releases. As it is now, relying only on three common utilities, it's quite universal.

All that said, if you have ideas for integrating this more tightly, I'd certainly like to hear them.

PM me and we can talk....

Report

C

marc41

10 years ago

P.S.

newrez CAN be launched from the panel. In addition, the little scripts it leaves in /tmp can also be launched from the panel, letting the user hop between their own defined resolutions. Perhaps a drawer full of them would make sense.

Is there a category for launcher-apps to post this to? :-)

Report

Cooleech

10 years ago

Yeah... about this script it leaves in /tmp... why in /tmp? Wouldn't it be much simpler to reach in $HOME dir? O.o

Report

C

marc41

10 years ago

Good point. Should I drop them in $HOME? Or maybe even $HOME/Desktop which will make them obvious AND clickable?? *AND* draggable to the launcher!!

What do you think?

Report

Cooleech

10 years ago

Sure, why not ;)

Report

C

marc41

10 years ago

Try version 0.5 ;-)

Report

9

mhnassif

10 years ago

Thanks a lot, working really good.
I was wondering is there any way to set the resolution by default to apply it each time session start without using startup applications.

Report

C

marc41

10 years ago

From what I've been reading about xrandr since putting this script together (it's been less than 24 hours), "maybe"...

There IS a way to use xrandr (along with "gtf" or "cvt") to create a new "mode". Once the new mode is created, it can be selected when configuring a display. If the new mode is added to /etc/X11/xorg.conf then it can be made permanent.

I will have to actually try this though. Every example I've seen of this described the resolution plus a number of things relating to scan rates and such, but nothing I've come across shows the use of "scale".

And SCALE is the reason this works. This script does not set a hardware resolution, it sets a framebuffer resolution and then scales it down to fit the hardware. So I have no idea (yet) if this can be used as a true "mode".

Further, most systems don't have an xorg.conf file any more. They auto-configure when X comes up. So even IF these modes work, they won't work for most users.

But, I'll give it a shot and report back :-)

-- Marc

Report

C

marc41

10 years ago

OK, there does not seem a way to make a proper mode for /etc/X11/xorg.conf. However (not for the faint of heart) THIS seems to work:

Copy your favorite /tmp/newrez-XXXX script from /tmp to /etc/X11/xinit/xinitrc.d
Edit the script as follows:
.enclose the entire line in parenthesis
.just after the open-parenthesis, insert: sleep15;
.after the close parenthesis, append: &

On a slower laptop, you may need a longer sleep (the xrandr must not run until X is up)

Report

9

mhnassif

10 years ago

I Added this line to xinitrc

(sleep20; xrandr --fb 1497x936 --output LVDS1 --scale 1.17x1.17)&

it didn't work, is there something wrong with the line?

Report

7 years ago

Check my other scripts, too!
(VOTE!!)


0.1 - initial version
0.2 - minor cosmetic fix for older zenity versions
0.3 - when run, the "xrandr" command is saved in a 1-line script ~/newrez-devname-XXXX
0.4 - corrected parsing when multiple monitors are detected
0.5 - a gnome-panel launcher icon can be created automatically
0.6 - better panel icon creation
0.7 - much more thorough testing to ensure proper versions of xrandr and gnome-panel-add
0.8 - Added "newrez-v" which is an entirely different approach to compensate for "constrained mouse" issue in latest xrandr. newrez-v starts a vncserver at a higher resolution and then starts a vncviewer in scaled mode. Not as elegant, not as fast, but will work on ALL systems.

0.9 is a rewrite, and avoids the problems of a confined mouse by defining new resolutions to the VGA output, then scaling for display on the LCD. It's been tested in gnome2 and gnome3 as well as the MATE and Cinnamon desktops.

1.1 fixed issue when returning to "default" resolution, where mouse was not confined to screen edges.

12345678910
18
product-maker ofxxx Oct 26 2016 9 excellent
product-maker teresaejunior Aug 11 2013 9 excellent
product-maker I4C Feb 19 2013 9 excellent
product-maker kutalion Jan 20 2013 9 excellent
product-maker fanoy Jan 11 2012 9 excellent
product-maker markjm1971 Jan 02 2012 9 excellent
product-maker raoulr Mar 06 2011 9 excellent
product-maker kolesky Feb 18 2011 9 excellent
product-maker TheRob Feb 17 2011 9 excellent
product-maker mywindow Nov 19 2010 9 excellent
product-maker mhnassif Nov 14 2010 9 excellent
product-maker nenelinux Nov 10 2010 9 excellent
product-maker larryni Nov 09 2010 9 excellent
product-maker cochisepoeta Nov 09 2010 9 excellent
product-maker DanRock007 Nov 09 2010 9 excellent
product-maker benjamimgois Nov 09 2010 9 excellent
product-maker joshiggins Nov 09 2010 9 excellent
product-maker influxor Nov 09 2010 9 excellent
Be the first to comment
raoulr
Jul 20 2013
kutalion
Jan 20 2013
mywindow
Nov 19 2010
mhnassif
Nov 12 2010
nenelinux
Nov 10 2010
swordjr
Nov 09 2010
larryni
Nov 09 2010
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
1.1
updated Dec 20 2013
added Nov 09 2010
downloads 24h
1
mediaviews 24h 0
pageviews 24h 18
System Tags addon