#!/bin/bash
# XFCE session startup for a VNC (Xvnc) display.
# Shipped by the xfce4-desktop package at /usr/share/xfce4-desktop/xstartup.
# Copied into ~/.vnc/xstartup by xfce4-desktop-vnc-install.sh (never automatically).

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

# Force a plain X11 XFCE session (VNC has no Wayland compositor).
export XDG_SESSION_TYPE=x11
export XDG_CURRENT_DESKTOP=XFCE
export XDG_SESSION_DESKTOP=XFCE

# vncserver assigns DISPLAY for this session -- do not hardcode it.
[ -r "$HOME/.Xresources" ] && xrdb "$HOME/.Xresources"

# exec keeps the session alive for the lifetime of the Xvnc display
# (a backgrounded 'startxfce4 &' would return immediately and end the session).
exec startxfce4
