Changes

From Amahi Wiki
Jump to: navigation, search
2,797 bytes added ,  14:13, 26 October 2010
Per CPG's suggestion, I'm adding instructions for making a quick resolution changing script.
* [http://content.screencast.com/users/spatialguru/folders/Jing/media/996c7c1d-05a9-4a92-9d87-f89167742a3c/00000032.png Screenshot] of desktop sharing setup below (sorry it's so huge).
 
== Quickly Change Resolution ==
You can create a script to quickly change the resolution of your HDA's desktop and update your WebVNC window. This technique involves keeping several different configuration files for your WebVNC and adjusting a symlink to reference the correct configuration.
 
First, as root, make a copy of your WebVNC webpage configuration in your user folder for EACH desired resolution, with the following commands:
 
cd /var/hda/web-apps/webvnc/html
cp index.html /home/%USER%/.amahi.webvnc.800x600.index.html
cp index.html /home/%USER%/.amahi.webvnc.1024x768.index.html
cp index.html /home/%USER%/.amahi.webvnc.1280x1024.index.html
 
You will need to edit each of these files to change the size of the VNC window inside the web page. The width of the window should match the width of your desktop, however the height of the window should have 22px added to the height of the desktop in order to account for the WebVNC menu. For example, for the resolution 800x600, the html file will look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">>
<head>
<title>WebVNC Client</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<head>
<body style="font-size:8px;background-color:#000000;font-family:arial, helvetica, sans-serif;font-color:#007500;text-align:center;">
<div style="position:relative;margin: 0 auto;width:800px;height:622px;">
<applet code=VncViewer.class codebase=classes/ width="800" height="622">
<param name=PORT value=5900>
<param name="Open New Window" value="no">
</applet><br />
</div>
<a href="http://hda/">Return to HDA Home</a>
</body>
</html>
 
Next, remove the original index.html file and create a symlink to the appropriate new file:
 
rm index.html
ln -s /home/%USER%/.amahi.webvnc.800x600.index.html index.html
 
Now you need a script in order to change the resolution of the desktop AND update the symlink to the correct configuration. Create a file in /home/%USER%/Scripts/ for each desired resolution, for example, amahi.webvnc.reschange.800x600.sh containing the following, making sure to enter your sudo password and the desired resolution:
 
#!/bin/bash
echo ::password:: | sudo -S rm -f /var/hda/web-apps/webvnc/html/index.html
sudo ln -s /home/%USER%/.amahi.webvnc.800x600.index.html /var/hda/web-apps/webvnc/html/index.html
sudo xrandr -s 800x600
 
Finally, make each of your scripts executable (chmod u+x %SCRIPT%), place a drawer on your panel with a launcher to each of your scripts, then to change resolutions select your launcher and refresh your WebVNC window.
== Troubleshooting ==
2

edits