Skip to content

Commit a70016b

Browse files
committed
feat: fixed resolution
1 parent d3c2654 commit a70016b

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ docker run -it --rm -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword dorowu/ub
3838
A prompt will ask password either in the browser or vnc viewer.
3939

4040

41+
Screen Resolution
42+
------------------
43+
44+
Resolution of virtual desktop adapts browser window size when first connecting the server. You may choose a fixed resolution by passing `RESOLUTION` environment variable, for example
45+
46+
```
47+
docker run -it --rm -p 6080:80 -e RESOLUTION=1920x1080 dorowu/ubuntu-desktop-lxde-vnc
48+
```
49+
4150
Troubleshooting and FAQ
4251
==================
4352

image/startup.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ if [ -n "$VNC_PASSWORD" ]; then
1414
export VNC_PASSWORD=
1515
fi
1616

17-
cd /usr/lib/web && ./run.py > /var/log/web.log 2>&1 &
17+
if [ -n "$RESOLUTION" ]; then
18+
sed -i "s/1024x768/$RESOLUTION/" /etc/supervisor/conf.d/supervisord.conf
19+
fi
20+
21+
cd /usr/lib/web && ./run.py 2>&1 &
1822
nginx -c /etc/nginx/nginx.conf
1923
exec /bin/tini -- /usr/bin/supervisord -n

image/usr/lib/web/lightop/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
CONFIG = os.environ.get('CONFIG') or 'config.Development'
1919
app.config.from_object('config.Default')
2020
app.config.from_object(CONFIG)
21+
FIRST = 'RESOLUTION' not in os.environ
22+
2123

2224
# logging
2325
import logging

0 commit comments

Comments
 (0)