-
Notifications
You must be signed in to change notification settings - Fork 50
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
LXQt Session Settings: Add a way to Ignore Default Environment Variables Per User - or unset them #273
Comments
please provide your configs and the not working environment variables. |
just tested - works fine for me:
q.e.d. |
Steps to reproduce behavior:
~ $ grep GTK /usr/share/lxqt/session.conf GTK_CSD=0 GTK_OVERLAY_SCROLLING=0 --- ~ $ grep GTK $HOME/.config/lxqt/session.conf --- ~ $ env | grep GTK GTK_CSD=0 GTK_MODULES=canberra-gtk-module GTK_OVERLAY_SCROLLING=0 The problem here is that setting these variables at all causes Client Side Decorations to be enabled in gtk3-mushrooms. I went about removing GTK_CSD and GTK_OVERLAY_SCROLLING lines in /usr/share/lxqt/session.conf as shown below: [General] window_manager=openbox leave_confirmation=true [Environment] [Mouse] cursor_size=18 cursor_theme=whiteglass acc_factor=20 acc_threshold=10 left_handed=false [Keyboard] delay=500 interval=30 beep=false [Font] antialias=true hinting=true dpi=96 Notice the empty [Environment] section. After this alteration, my environment looks like thus: ~ $ grep GTK /usr/share/lxqt/session.conf ~ $ grep GTK $HOME/.config/lxqt/session.conf ~ $ env | grep GTK GTK_MODULES=canberra-gtk-module Due to this, gtk3-mushrooms works now without issue; but this has revealed that the system-wide configuration is overriding per-user configuration for session.conf for environment variables when removed by user (i.e., I'd appreciate a way to ignore these somehow without editing /usr/share/lxqt/session.conf) |
and i see no problem in the behaviour - that is exactly what xdg should do - reading configurations in different levels: 0: /usr/share/ - not used More verbose: you deleted the GTK* lines so the valid settings from level 1 are valid. in my example i set GTK_CSD to an empty value. The only thing the application can't do right now is to unset some things - also to be expected. |
if 0 is really needed to activate and 1 to force all the things - try to blank them '' or -1 might work EDIT: It might be worth it for the session to implement a mechanism to unset some enviromental variables (at all levels) so i reopen the issue |
@tsujan @palinek @luis-pereira @yan12125 - what do you think? |
Reference is: lah7/gtk3-classic#15 and Tomasz is very clear about the need of
or another value instead of |
@agaida I didn't follow the discussion but |
In other words, if there is a line |
@tsujan - and we might have a problem with that. If we read something from the [Environment] section we can only set a environmental variable - but not unset it. That might be a major difference in some cases. |
To unset an environment variable, the code needs to support unsetting. |
Right - and i hereby suggest to implement it, hopefully it is not rocket science |
Should be very easy. |
@agaida Since I'm not familiar with the code, I just make a suggestion here. Try changing the function lxqt_setenv to: void lxqt_setenv(const char *env, const QByteArray &value)
{
wordexp_t p;
wordexp(value.constData(), &p, 0);
if (p.we_wordc == 1)
{
qCDebug(SESSION) << "Environment variable" << env << "=" << p.we_wordv[0];
if (p.we_wordv[0])
qputenv(env, p.we_wordv[0]);
else
qunsetenv(env);
}
else
{
qCWarning(SESSION) << "Error expanding environment variable" << env << "=" << value;
if (!value.isEmpty())
qputenv(env, value);
else
qunsetenv(env);
}
wordfree(&p);
} Then, if the variable value is empty, it should be unset. |
Thats exactly the point - we talk about shells - in some cases it is only asked if the variable is set - the value is not important. Thats why i asked explicitly how to unset a certain environmental variable. |
Qt doc says about
|
right - i was only thinking about the distinction of setting a value to 0 or blank and unset a variable - we should make a difference i guess. |
What would be its use? An example where that distinction is necessary? |
Is that the example? |
GTK+ doc explicitly says:
So, I don't think unsetting an EV could have any use. This can be closed again, IMO. |
That's the opposite of what GTK doc says; hence the problem. I really don't think it's our problem. |
it a problem in general - i have seen such things in the past a few times - and it wasn't about some X things like gtk-mushroom. Have seen it in daemons a lot. So i would prefer if we really could unset things - like in $foo=unset -> unset foo Edit: This bug was only a reminder. |
IMO, a good app should NOT react to an EV in this way. That doesn't mean |
As i said - i stumbled over these things a few times in the past ten years - and i guess it will not hurt if we can implement it without pain - setting things to blank is allways possible and ever was - so no changes needed. But making it possible to unset things would be nice. |
That may mean that you encountered bugs in apps. I see no reason to add workarounds for certain bugs. |
Setting an EV to blank does set it to blank ;) |
yes - and an EV can be set or unset - thats why the unset exists - isset(foo) is legit and was/is often used. |
Theoretically, a checkbox could be added in front of every EV and if its unchecked, that EV would be unset. If the box is checked but the value is blank, the EV would be set to blank. Just a plan -- not for myself though ;) |
A box would be fine to - and when we are on it we should remove the |
LXQt has a system-wide session.conf which is located in Arch at /usr/share/lxqt/session.conf. This provides some defaults for LXQt, including default environment variables. These variables should be overridden on a per-user basis (i.e., as with most other Linux programs) in ~/.config/lxqt/session.conf. The opposite seems to be occurring (i.e., system-wide session.conf overrides per-user session.conf).
Setting environment variables in LXQt Session Settings should override system-wide defaults as expected.
System-wide default environment variables override per-user session.conf if the lines are blank in the per-user session.conf.
Change the precedence/load order in Session settings in case lines are blank (i.e., add a way to ignore system default environment variables when deleted from per-user session.conf)
This issue was discovered when trying to get gtk3-mushrooms working with LXQt.
lah7/gtk3-classic#15 (comment)
The text was updated successfully, but these errors were encountered: