After a long time, I finally came back to analysing this issue and embarrassingly found out that the exports were working, but I had two conflicting exports, through .zprofile
and .xsessionrc
for the same variable.
Also, I've noticed that for some reason, probably security related?, you can't simply inspect the LD_PRELOAD
variable. It will always return empty.
Though the answer isn't much, I do feel it would be worthwhile to share how I tracked down the issue.
- My first clue was
.xsession-errors
which properly logs all stuff related to X. In that file, I could see that LD_PRELOAD
was being set twice on logon.
- After that, I just searched the exact line of code in all my files using
grep -rnw ~/* -e "export LD_PRELOAD"
. It clearly indicated the respective files which had the lines, .zprofile
and .xsessionrc
and I was able to fix the issue.
Update:
It seems that LD_PRELOAD
was being unset
by KDE after sourcing ~/.xsessionrc
that's why export
wasn't reporting anything. I've moved the export
statement to ~/.zshrc
for now.
export
ing variables in.sh
(executable?) files in~/.config/plasma-workspace/env/
is the officially supported way, it should work (and I can confirm it works on Arch Linux with KDE + SDDM). Where are you executingecho $LD_PRELOAD
? (E.g. Bash in Konsole?) Did you check ifLD_PRELOAD
is unset/changed somewhere in your shell startup scripts?echo $LD_PRELOAD
in my terminal. Also, I'm only usingenv.sh
as a startup script so something else is off. And myenv.sh
is getting executed since other variables in it have been exported. I read~/.xsession_errors
and it does show$LD_PRELOAD
as being exported, however I can't find anything which might be unsetting it.