# Python X2Go (Client) API Documentation (v0.6.1.4)

## x2go.xserver module

class x2go.xserver.X2GoClientXConfig(config_files=['/sbuild-nonexistent/.x2goclient/xconfig', '/etc/x2goclient/xconfig'], defaults={}, logger=None, loglevel=56)

  Bases: `X2GoIniFile`

  Configuration file based XServer startup settings for X2GoClient instances.

  This class is needed for Windows systems and (maybe soon) for Unix desktops using Wayland.

  detect_unused_xdisplay_port(xserver_name)

    Get an unused TCP/IP port for the to-be-launched X server and write it to the user’s X configuration file.

    Parameters:

      xserver_name (`str`) – name of the XServer application

  get_xserver_config(xserver_name)

    Retrieve the XServer configuration (from the xconfig file) for the given XServer application.

    Parameters:

      xserver_name (`str`) – name of the XServer application

    Returns:

      A Python dictionary containing the XServer’s configuration settings

    Return type:

      `list`

  property installed_xservers

    Among the known XServers renders a list of XServers that are actually installed on the system.

  property known_xservers

    Renders a list of XServers that are known to Python X2Go.

  property preferred_xserver

    Returns a tuple of (<xserver_name>, <xserver_config>).

    Returns:

      xserver_name>, <xserver_config>)

    Return type:

      `tuple`

  property preferred_xserver_names

    Returns the list of preferred XServer names (most preferred first).

  property running_xservers

    Tries to render a list of running XServer processes from the system’s process list.

  write()

    Store the Xserver configuration to the storage backend (i.e. on disk).

    For writing the first of the `config_files` specified on instance construction that is writable will be used.

    Returns:

      `True` if the user config file has been successfully written, `False` otherwise.

    Return type:

      `bool`

  property xserver_launch_needed

    Detect if an XServer launch is really needed (or if we use an already running XServer instance). Equals `True` if we have to launch an XServer before we can start/resume X2Go sessions.

  property xserver_launch_possible

    Detect if there is an XServer (that is known to Python X2Go) installed on the system. Equals `True` if we have found an installed XServer that we can launch.

class x2go.xserver.X2GoXServer(xserver_name, xserver_config, logger=None, loglevel=56)

  Bases: `Thread`

  This class is responsible for starting/stopping an external XServer application.

  X2Go applications require a running XServer on the client system. This class will manage/handle the XServer while your X2Go application is running.

  run()

    Start this `x2go.xserver.X2GoXServer` thread. This will launch the configured XServer application.

  stop_thread()

    A call to this method will stop the XServer application and do a cleanup afterwards.