xpra icon
Bug tracker and wiki

Ticket #172: 0001-build-xpra.conf-from-template.patch

File 0001-build-xpra.conf-from-template.patch, 6.2 KB (added by Benoit Gschwind, 5 years ago)
  • new file src/etc/xpra/xpra.conf.in

    From 3de1acb4558a178b69b491b0c85a953719fb21bc Mon Sep 17 00:00:00 2001
    From: Benoit Gschwind <gschwind@gnu-log.net>
    Date: Sat, 14 Jun 2014 14:41:04 +0200
    Subject: [PATCH 1/2] build xpra.conf from template
    
    ---
     src/etc/xpra/xpra.conf.in | 156 ++++++++++++++++++++++++++++++++++++++++++++++
     src/setup.py              |  16 ++++-
     2 files changed, 169 insertions(+), 3 deletions(-)
     create mode 100644 src/etc/xpra/xpra.conf.in
    
    diff --git a/src/etc/xpra/xpra.conf.in b/src/etc/xpra/xpra.conf.in
    new file mode 100644
    index 0000000..0673f02
    - +  
     1#
     2# This is the default configuration file for Xpra
     3#
     4# You can provide default values for most command line
     5# options here.
     6# All options can be overriden on the xpra command line.
     7# See the man page for details.
     8# Options which can be turned on or off will accept
     9# the following values: 1, 0, true, false, yes, no
     10
     11# Commands to start by default (may be specified more than once):
     12#start-child = /usr/bin/xterm
     13#start-child = /usr/bin/xeyes
     14
     15# Enable clipboard forwarding:
     16clipboard = yes
     17
     18# Enable forwarding of notifications:
     19notifications = yes
     20
     21# Enable forwarding of system tray icons:
     22system-tray = yes
     23
     24# Start a pulseaudio server with each session:
     25pulseaudio = yes
     26
     27# pulseaudio server start command:
     28pulseaudio-command = pulseaudio --start --daemonize=false --system=false \
     29                --exit-idle-time=-1 -n --load=module-suspend-on-idle \
     30                --load=module-null-sink --load=module-native-protocol-unix \
     31                --log-level=2 --log-target=stderr
     32
     33# Forward sound output to clients:
     34speaker = yes
     35
     36# Codec(s) to use for forwarding speaker sound:
     37#speaker-codec = mp3
     38#speaker-codec = flac
     39#speaker-codec = wav
     40#speaker-codec = wavpack
     41#speaker-codec = speex
     42#speaker-codec = opus
     43
     44# Forward sound input to server:
     45# microphone = yes
     46
     47# Codec(s) to use for forwarding microphone sound:
     48#microphone-codec = mp3
     49#microphone-codec = flac
     50#microphone-codec = wav
     51#microphone-codec = wavpack
     52#microphone-codec = speex
     53#microphone-codec = opus
     54
     55# Enable shared memory transfers:
     56mmap = yes
     57
     58# Use server group ownership for mmap file:
     59mmap-group = no
     60
     61# Share session with other users:
     62sharing = no
     63
     64# Default compression (0 to 9):
     65compression_level = 1
     66
     67# Socket directory:
     68#socket-dir = /tmp
     69#socket-dir = ~/.xpra
     70
     71# Where to send non xpra clients:
     72#tcp-proxy = 127.0.0.1:80
     73
     74# Log file:
     75log-file = $DISPLAY.log
     76
     77# Publish sessions:
     78mdns = yes
     79
     80# Debugging:
     81#debug =
     82#debug = keyboard,clipboard,tray
     83
     84# OpenGL accelerated rendering:
     85#opengl = yes
     86#opengl = no
     87opengl = auto
     88
     89# Default encoding (not all encodings may be available in your environment):
     90#encoding = h264
     91#encoding = vp8
     92#encoding = vpx
     93#encoding = png
     94#encoding = jpeg
     95#encoding = rgb
     96#encoding = webp
     97
     98# Video encoders loaded by the server (all of them unless specified)
     99# examples:
     100#video-encoders=x264,vpx,nvenc
     101#video-encoders=x264
     102
     103# Colourspace conversion modules loaded by the server (all of them unless specified)
     104# examples:
     105#csc-modules=swscale,cython,opencl
     106#csc-modules=swscale
     107
     108# Use fixed quality:
     109#quality = 80
     110quality = auto
     111
     112# For auto quality, do not go below this value:
     113min-quality = 50
     114
     115# Use fixed speed:
     116#speed = 20
     117speed = auto
     118
     119# For auto speed, do not go below this value:
     120#min-speed = 20
     121min-speed = 0
     122
     123# Idle delay in seconds before doing an automatic lossless refresh:
     124auto-refresh-delay = 0.15
     125
     126# Default DPI:
     127dpi = 96
     128
     129# Client window title:
     130title = @title@ on @client-machine@
     131
     132# Icon used by the system tray:
     133#tray-icon = /path/to/icon.png
     134
     135# Keyboard synchronization:
     136keyboard-sync = yes
     137
     138# Send ping packets more regularly (every second):
     139pings = no
     140
     141# Client ssh command:
     142#ssh = /usr/bin/ssh
     143
     144# Virtual display command:
     145# - Old Xvfb option:
     146# xvfb=Xvfb +extension Composite -screen 0 3840x2560x24+32 -nolisten tcp -noreset -auth $XAUTHORITY
     147# - With Xorg 1.12 or newer and the dummy driver:
     148# xvfb=/usr/bin/Xorg -dpi 96 -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER -logfile ${HOME}/.xpra/Xorg.${DISPLAY}.log -config /etc/xpra/xorg.conf
     149#
     150# Selecting virtual X server:
     151xvfb=%(xvfb_command)s
     152
     153# Does the xvfb command support the "-displayfd" argument?
     154# (which versions do support this flag is very unclear)
     155displayfd = %(has_displayfd)s
     156
  • src/setup.py

    diff --git a/src/setup.py b/src/setup.py
    index da50713..f78f50f 100755
    a b def get_xorg_version(): 
    633633        xorg_version = None
    634634    return xorg_version
    635635
     636def build_xpra_conf(xvfb, displayfd):
     637    f_in = open("etc/xpra/xpra.conf.in", "r")
     638    f_out = open("etc/xpra/xpra.conf", "w")
     639    f_out.write((f_in.read()) % {'xvfb_command': xvfb, 'has_displayfd': displayfd})
     640    f_out.close()
     641    f_in.close()
     642
    636643def get_xorg_conf_and_script():
    637644    if not server_ENABLED:
    638645        return "etc/xpra/client-only/xpra.conf", False
    639646
    640647    def Xvfb():
    641         return "etc/xpra/Xvfb/xpra.conf", False
     648        build_xpra_conf("Xvfb +extension Composite -screen 0 3840x2560x24+32 -nolisten tcp -noreset -auth $XAUTHORITY", "no")
     649        return "etc/xpra/xpra.conf", False
    642650
    643651    if sys.platform.find("bsd")>=0:
    644652        print("Warning: sorry, no support for Xdummy on %s" % sys.platform)
    def get_xorg_conf_and_script(): 
    662670                print("Xorg is suid and not readable, Xdummy support unavailable")
    663671                return Xvfb()
    664672            print("%s is suid and readable, using the xpra_Xdummy wrapper" % XORG_BIN)
    665             return "etc/xpra/xpra_Xdummy/xpra.conf", True
     673            build_xpra_conf("xpra_Xdummy -dpi 96 -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER -logfile ${HOME}/.xpra/Xorg.${DISPLAY}.log -config /etc/xpra/xorg.conf", "no")
     674            return "etc/xpra/xpra.conf", True
    666675        else:
    667676            print("using Xdummy config file")
    668             return "etc/xpra/Xdummy/xpra.conf", False
     677            build_xpra_conf("Xorg -dpi 96 -noreset -nolisten tcp +extension GLX +extension RANDR +extension RENDER -logfile ${HOME}/.xpra/Xorg.${DISPLAY}.log -config /etc/xpra/xorg.conf", "no")
     678            return "etc/xpra/xpra.conf", False
    669679
    670680    if Xdummy_ENABLED is False:
    671681        return Xvfb()