Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override xstartup with environment variable #134

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ to start daemons (such as dbus, pulseaudio, etc) necessary for linux desktop
to work. This is the option kubernetes runs with by default, so most kubernetes
based JupyterHubs will not need any modifications for this to work.

## Configuration

The VNC server will default to launching `~/.vnc/xstartup`.
If this file does not exist jupyter-remote-desktop-proxy will use a bundled `xstartup` file that launches `dbus-launch xfce4-session`.
You can specify a custom script by setting the environment variable `JUPYTER_REMOTE_DESKTOP_PROXY_XSTARTUP`.

## Limitations

1. Desktop applications that require access to OpenGL are currently unsupported.
7 changes: 5 additions & 2 deletions jupyter_remote_desktop_proxy/setup_websockify.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ def setup_websockify():
unix_socket = False
vnc_args = [vncserver, '-localhost', '-rfbport', '{port}']

if not os.path.exists(os.path.expanduser('~/.vnc/xstartup')):
vnc_args.extend(['-xstartup', os.path.join(HERE, 'share/xstartup')])
xstartup = os.getenv("JUPYTER_REMOTE_DESKTOP_PROXY_XSTARTUP")
if not xstartup and not os.path.exists(os.path.expanduser('~/.vnc/xstartup')):
xstartup = os.path.join(HERE, 'share/xstartup')
if xstartup:
vnc_args.extend(['-xstartup', xstartup])

vnc_command = shlex.join(
vnc_args
Expand Down