Bug 464643 - environment variables are ignored if plasmashell is started by Systemd
Summary: environment variables are ignored if plasmashell is started by Systemd
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: Startup process (show other bugs)
Version: 5.26.5
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-22 11:22 UTC by Guido
Modified: 2023-01-24 18:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido 2023-01-22 11:22:21 UTC
I configured plasmashell to be started ad a systemd service and I set

QT_QPA_PLATFORMTHEME=qt6ct

in order to have qt6gtk2 theme for qt6 apps. 

When I launch qt6ct from the menu I got the error of bad configuration but if I launch qt6ct from the terminal I dont

And if I relaunch plasmashell from the terminal 

kquitapp5 plasmashell; kstart plasmashell

qt6ct from the menu works fine.

Strange enough not all qt6 apps seems affected. Glaxnimate respect the theme settings, while zint-qt not.

I tried to set the variable systemwide in /etc/profiles.d but plasma fails to start.
Comment 1 Nate Graham 2023-01-24 17:23:59 UTC
(In reply to Guido from comment #0)
> I configured plasmashell to be started ad a systemd service and I set
> 
> QT_QPA_PLATFORMTHEME=qt6ct
Exactly where and how did you set it?
Comment 2 Guido 2023-01-24 18:06:35 UTC
(In reply to Nate Graham from comment #1)
> (In reply to Guido from comment #0)
> > I configured plasmashell to be started ad a systemd service and I set
> > 
> > QT_QPA_PLATFORMTHEME=qt6ct
> Exactly where and how did you set it?

in several places... bashrc, fish, .profile, pam...
Comment 3 Nate Graham 2023-01-24 18:08:08 UTC
Does it work if you set it in /etc/environment?
Comment 4 Guido 2023-01-24 18:16:01 UTC
(In reply to Nate Graham from comment #3)
> Does it work if you set it in /etc/environment?

yes but I had strange behaviour setting it at system level. Sometimes Plasma doesnt start.
Comment 5 Nate Graham 2023-01-24 18:17:25 UTC
That's the right place to set it.

Doing this is not formally supported, so if you do, you're on your own. :)
Comment 6 Guido 2023-01-24 18:22:24 UTC
(In reply to Nate Graham from comment #5)
> That's the right place to set it.
> 
> Doing this is not formally supported, so if you do, you're on your own. :)

I see. It's a systemd fault.