[i3-discuss] Re: Set environment variable only for i3 session

  • From: Michael Stapelberg <michael@xxxxxxxx>
  • To: i3-discuss@xxxxxxxxxxxxx
  • Date: Tue, 22 Dec 2015 12:14:35 -0800

I recommend you start i3 from ~/.xsession and set any specific environment
variables in that file.

On Tue, Dec 22, 2015 at 11:45 AM, Florian Lindner <mailinglists@xxxxxx>
wrote:

Hello,

I need to set a enviromment variable:

QT_QPA_PLATFORMTHEME="qt5ct"

it's needed for KDE application when run under i3 and it's important to be
set
only under i3, somehow it makes KDE behave weird.

(side note: if anyone knows how to get icons for KDE 5 (KF5) application,
I'm
open to any other solutions) [1]

I tried to use ~/.profile

% cat .profile
if [ $XDG_CURRENT_DESKTOP="i3" ]; then
export QT_QPA_PLATFORMTHEME="qt5ct"
fi

export FLO_TEST_DOTPROFILE="flotest"

and ~/.xinitrc. But neither of these are even executed. ~/.pam_environment
works, but it's executed under KDE too and I can't put any if-logic there.

I use zsh, so .zprofile might be correct, but I don't want to have it set
for
shell sessions only, but for any applications started inside the session.

What is the best way to set a session wide environment variable only for
i3?

Login manager is SSDM, distribution is Arch.

Thanks and happy x-mas for whatever you are going to celebrate or not...
;-)

Florian

[1] https://forum.kde.org/viewtopic.php?f=224&t=128749




--
Best regards,
Michael

Other related posts: