-
Notifications
You must be signed in to change notification settings - Fork 236
utils: preserve more KDE-related environment variables #1696
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
base: main
Are you sure you want to change the base?
Conversation
Build failed. ✔️ unit-test SUCCESS in 2m 15s |
A KDE session sets some environment variables to influence the behaviour of various programs and to access various settings [1]. eg., if the KDE_SESSION_VERSION environment variable is absent then applications won't respect KDE's theme or display scaling settings. These environment variables are not meant to be set by the shell's start-up scripts, but directly by KDE, and hence needs to be preserved across the host operating system and Toolbx container. [1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables containers#1696
A KDE session sets some environment variables to influence the behaviour of various programs and to access various settings [1]. eg., if the KDE_SESSION_VERSION environment variable is absent then applications won't respect KDE's theme or display scaling settings. These environment variables are not meant to be set by the shell's start-up scripts, but directly by KDE, and hence needs to be preserved across the host operating system and Toolbx container. [1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables containers#1696 containers#1698
A KDE session sets some environment variables to influence the behaviour of various programs and to access various settings [1]. eg., if the KDE_SESSION_VERSION environment variable is absent then applications won't respect KDE's theme or display scaling settings. These environment variables are not meant to be set by the shell's start-up scripts, but directly by KDE, and hence needs to be preserved across the host operating system and Toolbx container. [1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables containers#1696 containers#1698
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, @bkoropoff !
I didn't have time to go through all the environment variables. However, KDE_FULL_SESSION
and KDE_SESSION_VERSION
look obviously correct, based on your report and the KDE documentation. Therefore, I split them into #1698 to be able to include them in the new Toolbx release that I am preparing, so that at least some of your problems are addressed soon.
Hey @grulja ! Do you have any comments on preserving the values of these environment variables inside Toolbx containers?
Sometimes I think that we should change Toolbx's current approach of preserving only some environment variables, particularly those that are not set by the user in their shell start-up files, to one where it preserves all variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to add tests for any of these environment variables that you think can be useful.
For the record, I have the same setup (Kinoite 42) and I don't have any issue with Qt applications not being properly scaled or themed when running inside Toolbox. I really wonder whether |
If toolbox continues to preserve only some environment variables, it might be good to make the list configurable through files in XDG_CONFIG_HOME and XDG_CONFIG_DIRS (thus picking up system defaults in |
Konsole injects the name of the current profile, and the identifiers of the current tab and window into the process running inside it through the KONSOLE_PROFILE_NAME, KONSOLE_DBUS_SESSION and KONSOLE_DBUS_WINDOW environment variables respectively [1,2,3]. These are used by programs like Neovim to detect the terminal features supported by Konsole [4,5], or by users to save the shell's history separately for each profile, tab or window [6]. These environment variables are not meant to be set by the shell's start-up scripts, but directly by Konsole, and hence needs to be preserved across the host operating system and Toolbx container. Note that KONSOLE_PROFILE_NAME was later removed from Konsole [7]. However, Neovim still uses it, so it's better to preserve it. [1] Konsole commit debfec2eb3c8ede8 https://invent.kde.org/utilities/konsole/-/commit/debfec2eb3c8ede8 https://bugs.kde.org/show_bug.cgi?id=227296 [2] Konsole commit fcd815256c3729f2 https://invent.kde.org/utilities/konsole/-/commit/fcd815256c3729f2 [3] Konsole commit 07cddfe302233c35 https://invent.kde.org/utilities/konsole/-/commit/07cddfe302233c35 https://bugs.kde.org/show_bug.cgi?id=276912 https://bugs.kde.org/show_bug.cgi?id=281513 https://bugs.kde.org/show_bug.cgi?id=292309 [4] Neovim commit 5fc4c2d442f01ab5 neovim/neovim@5fc4c2d442f01ab5 neovim/neovim#3129 [5] Neovim commit 3ccd59ee8216f3da neovim/neovim@3ccd59ee8216f3da neovim/neovim#6432 neovim/neovim#6429 neovim/neovim#6430 [6] https://userbase.kde.org/Konsole/en [7] Konsole commit 9e3a30fdca2078e0 https://invent.kde.org/utilities/konsole/-/commit/9e3a30fdca2078e0 https://bugs.kde.org/show_bug.cgi?id=406955 containers#1449 containers#1696 containers#1698
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found myself waiting for CI to complete, so I decided to poke at some more of these environment variables.
I included KONSOLE_DBUS_SESSION
, KONSOLE_DBUS_WINDOW
and KONSOLE_PROFILE_NAME
in #1698 because they are mentioned in the Konsole documentation and Neovim uses them.
Toolbx has a configuration file. We can add a |
Thanks a lot for taking a look, @grulja ! |
A KDE session sets some environment variables to influence the behaviour of various programs and to access various settings [1]. eg., if the KDE_SESSION_VERSION environment variable is absent then applications won't respect KDE's theme or display scaling settings. These environment variables are not meant to be set by the shell's start-up scripts, but directly by KDE, and hence needs to be preserved across the host operating system and Toolbx container. [1] https://userbase.kde.org/KDE_System_Administration/Environment_Variables containers#1696 containers#1698
Konsole injects the name of the current profile, and the identifiers of the current tab and window into the process running inside it through the KONSOLE_PROFILE_NAME, KONSOLE_DBUS_SESSION and KONSOLE_DBUS_WINDOW environment variables respectively [1,2,3]. These are used by programs like Neovim to detect the terminal features supported by Konsole [4,5], or by users to save the shell's history separately for each profile, tab or window [6]. These environment variables are not meant to be set by the shell's start-up scripts, but directly by Konsole, and hence needs to be preserved across the host operating system and Toolbx container. Note that KONSOLE_PROFILE_NAME was later removed from Konsole [7]. However, Neovim still uses it, so it's better to preserve it. [1] Konsole commit debfec2eb3c8ede8 https://invent.kde.org/utilities/konsole/-/commit/debfec2eb3c8ede8 https://bugs.kde.org/show_bug.cgi?id=227296 [2] Konsole commit fcd815256c3729f2 https://invent.kde.org/utilities/konsole/-/commit/fcd815256c3729f2 [3] Konsole commit 07cddfe302233c35 https://invent.kde.org/utilities/konsole/-/commit/07cddfe302233c35 https://bugs.kde.org/show_bug.cgi?id=276912 https://bugs.kde.org/show_bug.cgi?id=281513 https://bugs.kde.org/show_bug.cgi?id=292309 [4] Neovim commit 5fc4c2d442f01ab5 neovim/neovim@5fc4c2d442f01ab5 neovim/neovim#3129 [5] Neovim commit 3ccd59ee8216f3da neovim/neovim@3ccd59ee8216f3da neovim/neovim#6432 neovim/neovim#6429 neovim/neovim#6430 [6] https://userbase.kde.org/Konsole/en [7] Konsole commit 9e3a30fdca2078e0 https://invent.kde.org/utilities/konsole/-/commit/9e3a30fdca2078e0 https://bugs.kde.org/show_bug.cgi?id=406955 containers#1449 containers#1696 containers#1698
Trying Also |
I noticed that Qt applications run in my toolbox container on Fedora Kinoite 42 did not respect KDE's theme or display scaling settings. It turns out this was due to the
KDE_SESSION_VERSION
environment variable missing. I went through all environment variables which KDE and konsole set in my session which weren't preserved and added them to the list for completeness. Let me know if you want some removed or split into separate commits.