Tip: Quickly Change Resolution
Posted: 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):
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:
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.
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
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 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.