eliasp / plasma-workspace-units

systemd user-session units for KDE Frameworks 5/Plasma 5
http://quickgit.kde.org/?p=plasma-systemd-integration.git
GNU General Public License v2.0
19 stars 4 forks source link

Some environment variables are not imported #16

Closed AnAkkk closed 9 years ago

AnAkkk commented 9 years ago

Doing a diff between the output of "export" during a normal plasma session and the systemd one show that some environment variables are missing. I guess it should import all environment variables, not only a few. For example: ANDROID_HOME ANDROID_SWT GS_LIB GTK_MODULES INFINALITY_FT_FILTER_PARAMS INFINALITY_FT_FRINGE_FILTER_STRENGTH INFINALITY_FT_USE_VARIOUS_TWEAKS INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH INFINALITY_FT_STEM_ALIGNMENT_STRENGTH INFINALITY_FT_STEM_FITTING_STRENGTH KDE_SESSION_UID MAVEN_OPTS MOZ_PLUGIN_PATH PATH (not missing, but different, android, java and perl paths are missing) QT_PLUGIN_PATH SSH_ASKPASS XDG_DATA_DIRS

AnAkkk commented 9 years ago

Changing the loop in startsystemd which import selected environment variables to

systemctl --user import-environment

seem to solve the issue, most of them are imported now. These are still missing though, not sure if it's normal: GS_LIB KDE_SESSION_UID QT_PLUGIN_PATH XDG_DATA_DIRS (maybe they are set by startkde and not useful anymore) And this one was added: MANAGERPID

eliasp commented 9 years ago

The very idea of using user-session services is, to have an as clean as possible environment for services to run in. I consider the current imports of environment variables to be mostly hacks or workarounds. A properly designed application shouldn't need any environment variables and should instead query whatever information source it needs dynamically. With this project, I'm targeting for laying out the fundamental pieces to provide a proper ground to build on further, but not to maximize functionality out of the original scope (e.g. infinality, Androit tools, etc.).

Whenever there's a hack implemented, it's just to get basic road blocks out of the way to make further progress, but in the long term, each hack should disappear again. Environment variables are one of them.

Feel free to maintain the required variables in your own fork for now.

Sorry for not really providing a solution for you here - I should probably make this project's scope more clear in the README.