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

  • From: Jeff Abrahamson <jeff@xxxxxxxxxx>
  • To: i3-discuss@xxxxxxxxxxxxx
  • Date: Wed, 23 Dec 2015 09:37:44 +0100

Sorry, I misread your message. I thought you were saying you were having
trouble detecting whether i3 was running or not, whereas you were concerned
with finding something that reliably executed at environment initialisation
time. So Michael's response is more appropriate.

Jeff Abrahamson
+33 6 24 40 01 57
+44 7920 594 255 <-- only when I'm in the UK
http://ml-week.com/ <http://www.ml-week.com/>* prochaine edition, 2016*

http://jeff.purple.com/
http://blog.purple.com/jeff/

On 23 December 2015 at 09:29, Florian Lindner <mailinglists@xxxxxx> wrote:

Am Dienstag, 22. Dezember 2015, 20:52:25 CET schrieb Jeff Abrahamson:
Typing

env | grep -i i3

should give you some solutions that work in your context.

Sorry, I can't see what you mean

% env | grep -i i3
DESKTOP_SESSION=/usr/share/xsessions/i3
XDG_CURRENT_DESKTOP=i3
XDG_SESSION_DESKTOP=i3


Jeff Abrahamson
+33 6 24 40 01 57
+44 7920 594 255 <-- only when I'm in the UK
http://ml-week.com/ <http://www.ml-week.com/>* prochaine edition,
2016*

http://jeff.purple.com/
http://blog.purple.com/jeff/

On 22 December 2015 at 20:45, 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




Other related posts: