Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to set some environment variables such as the XDG spec ones, before KDE starts in such a way that kwin and any apps run from KDE will inherit them. Where could I do this, and how?

share|improve this question
up vote 5 down vote accepted

Put them in a .sh file in ~/.kde/env/ (possibly ~/.kde4/env/ or similar; varies by distribution).

share|improve this answer
I've been trying that, but my XDG configs are still showing up in ~/.config such as ~/.config/akonadi, here's the scriptthat I copied to that directory. I actually gave this answer first, but deleted it when I realized it wasn't working – xenoterracide Jan 28 '11 at 23:20
@xenoterracide: The scripts must be named *.sh. – ephemient Jan 28 '11 at 23:21
well that's very un-unix-y gotcha's for the lose – xenoterracide Jan 28 '11 at 23:28
tested, and renaming to use .sh works, mind adding that as part of the answer? – xenoterracide Jan 28 '11 at 23:43

For Plasma 5 it's


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.