########################################################################
# Server Options:

# Directory for server log files:
#log-dir = /run/user/$UID
#log-dir = ~/.xpra
#log-dir = /tmp
#log-dir = ${XPRA_SESSION_DIR}
log-dir = auto

# Log file:
log-file = server.log

# Delegate "start" and "start-desktop" subcommands to the system-wide proxy server instance
#start-via-proxy = auto
start-via-proxy = no

# Scripts that can modify the environment of the server:
#source = /etc/xpra/server.env
source = /etc/profile

# Scripts that can modify the environment of the commands started by the server
# This one is useful for avoiding delays when running gnome applications:
#source-start = gnome-keyring-daemon --start

# Environment variables for children started
# with 'start-child' or 'start':
# (can be specified multiple times)
#start-env = HOME=/home/alt
#start-env = GDK_DEBUG=dnd
start-env = #avoid Ubuntu's global menu, which is a mess and cannot be forwarded:
start-env = UBUNTU_MENUPROXY=
start-env = QT_X11_NO_NATIVE_MENUBAR=1
start-env = #fix for MainSoft's MainWin buggy window management:
start-env = MWNOCAPTURE=true
start-env = MWNO_RIT=true
start-env = MWWM=allwm
start-env = #force GTK3 applications to use X11 so we can intercept them:
start-env = GDK_BACKEND=x11
start-env = #force Qt applications to use X11 so we can intercept them:
start-env = QT_QPA_PLATFORM=xcb
start-env = #disable Qt scaling:QT_AUTO_SCREEN_SET_FACTOR=0
start-env = QT_SCALE_FACTOR=1
start-env = #overlay scrollbars complicate things:GTK_OVERLAY_SCROLLING=0
start-env = #some versions of GTK3 honour this option, sadly not all:
start-env = GTK_CSD=0
start-env = #silence some AT-SPI and atk-bridge warnings:
start-env = NO_AT_BRIDGE=1

# Commands to start by default
#  (may be specified more than once):
# examples:
#start-child = /usr/bin/xterm
#start-child = /usr/bin/xeyes
#start=/bin/true
#
# Xsession can take care of initializing dbus, keyring-daemon,
# gpg-agent or whatever else might be usually started together with X
#start = /etc/X11/Xsession true
# Or you can specify individual actions:
#xrdb -merge /etc/X11/Xresources
#xrdb -merge ~/.Xresources
#
# The difference between start and start-child is only relevant
# when using exit-with-children.
# This causes the server to terminate when the last child has exited:
exit-with-children = no

# Commands to start immediately after the first client has connected:
# (see above for the start vs start-child distinction)
#start-after-connect = touch ~/.xpra/connect
#start-child-after-connect = xterm

# Commands to every time a client connects:
# (see above for the start vs start-child distinction)
#start-on-connect = touch ~/.xpra/login
#start-child-on-connect = xterm

# Commands to run when the last client exits:
#start-on-last-client-exit = xterm
#start-child-on-last-client-exit = xterm


# Start a dbus-daemon:
# dbus-launch =
# dbus-launch = /usr/bin/dbus-launch --close-stderr
dbus-launch = dbus-launch --sh-syntax --close-stderr

# Start a dbus server which can be used to interact with the server process:
#dbus-control = no
dbus-control = yes

# Forward client dbus rpc requests:
# (requires client configuration)
#dbus-proxy = no
dbus-proxy = yes

# A wrapper for executing all sub-commands:
# exec-wrapper = vglrun --
# exec-wrapper = vglrun -d :1 --

# Allows clients to start new commands in the server context:
#start-new-commands = no
start-new-commands = yes

# Start a pulseaudio server with each session:
pulseaudio = auto

# pulseaudio server start command:
pulseaudio-command = pulseaudio --start -n --daemonize=false --system=false --exit-idle-time=-1 --load=module-suspend-on-idle '--load=module-null-sink sink_name="Xpra-Speaker" sink_properties=device.description="Xpra\ Speaker"' '--load=module-null-sink sink_name="Xpra-Microphone" sink_properties=device.description="Xpra\ Microphone"' '--load=module-native-protocol-unix socket=$XPRA_PULSE_SERVER' --load=module-dbus-protocol --load=module-x11-publish --log-level=2 --log-target=stderr --enable-memfd=no

# commands used to configure the pulseaudio server:
# pactl set-source-volume SomeSource 20%
pulseaudio-configure-commands = pactl set-default-sink Xpra-Speaker
pulseaudio-configure-commands = pactl set-default-source Xpra-Microphone.monitor


# Systemd specific options:
# Wrap server start commands with systemd-run:
#systemd-run = no
#systemd-run = auto
systemd-run = auto

# Command line arguments passed to systemd-run:
#systemd-run-args = -p MemoryAccounting=true -p MemoryHigh=384M -p MemoryLimit=512M
#systemd-run-args = -p CPUAccounting=true -p CPUQuota=25%
