Skip to content

Commit

Permalink
Override xstartup with environment variable
Browse files Browse the repository at this point in the history
Defines the variable `JUPYTER_REMOTE_DESKTOP_PROXY_XSTARTUP` to launch a custom xstartup script
  • Loading branch information
manics committed Nov 4, 2024
1 parent 4f68d13 commit 3a025bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 3a025bb

Please sign in to comment.