Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add path-check, add XPRA_SYSCONF_DIR for xposix, add XDG_DATA_DIRS/icons to search path for pixmaps #3507

Closed
wants to merge 2 commits into from

Conversation

jhgoebbert
Copy link

@jhgoebbert jhgoebbert commented Mar 30, 2022

  1. The line
LOAD_APPLICATIONS = os.environ.get("XPRA_MENU_LOAD_APPLICATIONS", "%s/share/applications" % sys.prefix).split(":")

https://github.com/Xpra-org/xpra/blob/master/xpra/platform/xposix/menu_helper.py#L35
can return None and therefor needs to be checked for existance before use.

  1. Like it is already possible for OSX ( https://github.com/Xpra-org/xpra/blob/master/xpra/platform/darwin/paths.py#L93 )
    it would help if the environment variable XPRA_SYSCONF_DIR can be used to overwrite the system default path.

Example:
We have multiple installations of Xpra on the same multi-user systems of a few hpc-clusters. The user/workflow can choose which of these installations is loaded using lmod, a framework to load software when needed into the current environment.
Xpra is therefore no real system-installations as they are installed to special directories each, and they are no user-installations as they are not installed by the user.
Hence it is needed to avoid that xpra looks at system paths (/etc/xpra) for configuration files.

  1. XDG_DATA_DIRS/icons should added to the search paths for icons
    https://specifications.freedesktop.org/icon-theme-spec/latest/ar01s03.html

@jhgoebbert jhgoebbert changed the title add path-check, add XPRA_SYSCONF_DIR for xposix add path-check, add XPRA_SYSCONF_DIR for xposix, add XDG_DATA_DIRS/icons to search path for pixmaps Mar 30, 2022
@totaam
Copy link
Collaborator

totaam commented Mar 31, 2022

can return None and therefor needs to be checked for existance before use

No. This cannot return a None value.

Hence it is needed to avoid that xpra looks at system paths

What you want is XPRA_SYSTEM_CONF_DIRS:

def get_system_conf_dirs():
return envaslist_or_delegate("XPRA_SYSTEM_CONF_DIRS", do_get_system_conf_dirs)
def do_get_system_conf_dirs():
#overriden in all platforms
return []

@jhgoebbert
Copy link
Author

jhgoebbert commented Mar 31, 2022

No. This cannot return a None value.

Yes, you are right. But the check is for another reason required as it might not exist:

Python 3.9.6 (default, Nov 16 2021, 12:25:13)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> os.environ.get("XPRA_MENU_LOAD_APPLICATIONS", "%s/share/applications" % sys.prefix).split(":")
['/p/software/juwelsbooster/stages/2022/software/Python/3.9.6-GCCcore-11.2.0/share/applications']
>>>
[goebbert1@jwlogin23 juwels]$ ls /p/software/juwelsbooster/stages/2022/software/Python/3.9.6-GCCcore-11.2.0/share/applications
ls: cannot access '/p/software/juwelsbooster/stages/2022/software/Python/3.9.6-GCCcore-11.2.0/share/applications': No such file or directory

@jhgoebbert
Copy link
Author

I will check if XPRA_SYSTEM_CONF_DIRS solves (2) and create a new PR for (1) and (2) then.

@jhgoebbert jhgoebbert closed this Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants