this post was submitted on 28 Nov 2023
7 points (100.0% liked)

Arch Linux

7761 readers
2 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS
 

I'm trying to migrate from lightdm to just using startx to start my i3 session.

First I had issues with kdeconnect working which were fixed by replacing exec i3 with exec dbus-launch --exit-with-session i3 in the xinitrc.

Now even though the apps works it is not following the system theme, I checked qt5ct and it is telling me that QT_QPA_PLATFORMTHEME is not set to qt5ct.

But I do have export QT_QPA_PLATFORMTHEME=qt5ct on my ~/.profile it seems the file is not being read but I have no idea on how to fix it.

top 4 comments
sorted by: hot top controversial new old
[–] Ooops@kbin.social 3 points 11 months ago* (last edited 11 months ago) (1 children)

That's probably the ugly method but as it's my personal device I didn't see a problem adding such things to /etc/environment

PS: You should be able to also set this when starting i3 with "QT_QPA_PLATFORMTHEME=qt5ct i3"...

[–] Samueru@lemmy.ml 2 points 11 months ago (1 children)

Alright, adding the variable directly to /etc/enviroment made it work.

I also tried exporting the variable from my i3config and that didn't work.

Though why isn't it working like it did before with lightdm? Feels a bit wrong editing enviroment directly idk.

[–] Max_P@lemmy.max-p.me 2 points 11 months ago (1 children)

Display managers set some variables like XDG_SESSION_DESKTOP which helps software figure out how to handle some things, like where is the Qt config provider.

You may want to look at what the session file sets, or log in with lightdm, run env and save it, then again with plain xinit and compare the two to find out exactly what it sets.

But technically you're only manually doing what the DM would do already so it's not crazy dirty. When starting i3 manually, you're skipping a bunch of setup code. I don't know why setting it in i3config doesn't work, I don't use i3. But you can probably put it in your .profile to make it less dirty.

[–] Samueru@lemmy.ml 1 points 11 months ago* (last edited 11 months ago)

i3 is actually exporting the enviroment variables when I set them in its config file, however for some reason qt5ct and all the qt apps refuse to use it, running printenv confirms that it is there.

However I found the issue, it seems to be an issue with my zsh shell, because I just created ~/.zshenv and added my enviroment variables there instead of on ~/.profile and now it works like it should kek. I didn't have to do this before when using lightdm so no idea what exactly changed though.

It is likely that the qt enviroment variable needs to be exported very early and that is why doing it from i3 doesn't work but from the shell it does.