Tip: Quickly Change Resolution

surfrock66
Posts: 38
Joined: Sun May 30, 2010 8:29 am

Tip: Quickly Change Resolution

Postby surfrock66 » Mon Sep 27, 2010 9:31 pm

I rely on WebVNC a ton, but when I'm remote the lag is pretty bad. When I'm home on another machine, no problem. This has caused me to search for a quick way to change resolutions. I keep 1280x1024 as default, but I have a need for others. Here's what I did (as root):

Code: Select all

cd /var/hda/web-apps/webvnc/html cp index.html /home/surfrock66/.amahi.webvnc.800x600.index.html cp index.html /home/surfrock66/.amahi.webvnc.1024x768.index.html cp index.html /home/surfrock66/.amahi.webvnc.1280x1024.index.html rm index.html ln -s /home/surfrock66/.amahi.webvnc.1280x1024.index.html index.html
You then have to edit the index.html files for each version of your WebVNC session. Remember to make the height 22px larger than whatever your screen size is. You could theoretically do this for ANY supported resolution.

I then made a script for each resolution I wanted that changes the symlink, and changes the resolution. Here's my 800x600 one:

Code: Select all

#!/bin/bash echo ::password:: | sudo -S rm -f /var/hda/web-apps/webvnc/html/index.html sudo ln -s /home/surfrock66/.amahi.webvnc.800x600.index.html /var/hda/web-apps/webvnc/html/index.html sudo xrandr -s 800x600
I then make the script executable, and voila! I put a drawer on my panel with shortcuts to all 3 scripts, so to change resolutions, I just click the icon for the size I want, then refresh the VNC window. I kinda wish I knew a better way to run sudo without leaving my password in an open .sh file, but I'm pretty new to scripting.

I made the icons the same one for the display manager, which is located at /usr/share/icons/hicolor/scalable/apps/gnome-display-properties.svg

This has made my life MUCH easier. I have a widescreen one for getting on from my netbook, a big one from my main home desktop, and a small one from accessing at work. This has greatly eased the use of WebVNC from home.

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Tip: Quickly Change Resolution

Postby cpg » Tue Oct 26, 2010 12:35 am

Nice! How about putting it in the wiki at the end of the WebVNC page (or in a separate page)?
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

surfrock66
Posts: 38
Joined: Sun May 30, 2010 8:29 am

Re: Tip: Quickly Change Resolution

Postby surfrock66 » Tue Oct 26, 2010 7:15 am

Added to the wiki.

Who is online

Users browsing this forum: No registered users and 22 guests