Bug 464643

Summary: environment variables are ignored if plasmashell is started by Systemd
Product: [Plasma] plasmashell Reporter: Guido <guido.iodice>
Component: Startup processAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kde, nate
Priority: NOR    
Version First Reported In: 5.26.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.