KDE - Can't set environment variables

Hi all,

Installed Leap 42.1 today (sorry but a directory listing denial on the mirrors isn’t enough to keep the ISO from me :stuck_out_tongue: ).

New to KDE & openSUSE, not to Linux.

I am wanting to set an environment variable, my understanding is that the correct place for me to do it is ~/.config/plasma-workspace/env/whatever.sh
Scripts in ~/.config/plasma-workspace/env/ do get run (like i can put “touch /tmp/test” in there and that file will indeed be touched when i log in) but environment variables set in there don’t seem to stick.
I tried just setting them, exporting, setting followed by exporting, and even tried using readonly but the variables are never set post-login.

What am i doing wrong?

Depends on what you want and when you want to set the variable. Maybe explain what you want in more detail.

You do understand the life of a environmental variable?? A evar set in a parent process is inherited by any children but a evar set in a child is not transmitted back to the parent

I want to set KDE_MULTIHEAD=false so KWin doesn’t start on my second screen. The second screen in question is a TV. When i activate KWin’s Grid and swap to a different virtual desktop i don’t want the second screen also changing desktop. I have Xorg setup and working as desired in ‘Zaphod’ mode (separate X screens). I want to run Fluxbox on the X screen that is my TV.

I found documentation[1][2] stating that for KDE environment variables should be in the earlier mentioned folder.
I read that the variables in there are sourced, as opposed to the scripts actually being executed[3] (though my touch command test perhaps indicates otherwise?).

[1] https://community.kde.org/Plasma/5.1_Errata#Configuration_changes
[2] https://en.opensuse.org/SDB:KDE_Plasma_5#Environment_variables
[3] http://jpwhiting.blogspot.com.au/2014/11/autostart-in-plasma-5.html

So i used /etc/profile.d/whatever.sh to set the variable instead.
Now in KDE if i open a terminal and echo the variable, it still doesn’t return as set to false, but there is only 1 KWin process running now.:sarcastic:

Fluxbox still doesn’t want to start on the second screen though :frowning: …but Openbox does, so i guess at this point it’s a Fluxbox issue.
I suppose Openbox will do for my purposes. It’s not like i need much, just the ability to launch a media player and a file manager.

A really dumb question: have you installed the xorg-x11-server-extra package?The reason being that, you will possibly need Xephyr to configure your X.org Multiseat configuration.

Another point: have you read the X.org Multiseat documentation?http://www.x.org/wiki/Development/Documentation/Multiseat/

I’m not using any form of multiseat (and if viable, it’d be overkill for what i’m wanting), just separate X screens (‘Zaphod’ mode). I’ve been using Xorg this way for years.

I’ve always been an Xfce user favouring GTK apps, with Xfce (with either Xfwm4 or Compiz as window manager) i can achieve exactly what i want. Any number of other WM’s could also do what i want. It’s just that KWin has problems when your multi-monitor method is Zaphod rather than Xinerama (known issue). Apps on screens that aren’t the first one crash at the drop of a hat (well, Dolphin was anyway) and there’s other problems, which is why i want to run a different WM on the second screen.

At the end of the (rather long) discussion in the KDE Bug #256242 (URL in the previous text from korrode) there’s an attachment dated 29th September 2015 with an example X.Org Zaphod configuration [not from me]. :wink:

In the discussion in KDE Bug #324483 there’s a hint for setting the KDE_MULTIHEAD variable on a per user basis by means of KDE’s pre-startup behaviour. For KDE4/Plasma the location is as follows (please note the KDE needs the ‘.sh’ suffix on the (executable) shell file name):

> l .kde4/env/
insgesamt 0
drwxr-xr-x 2 xxx users  38 20. Aug 13:20 ./
drwx------ 6 xxx users 122 27. Okt 15:25 ../
lrwxrwxrwx 1 xxx users  30 20. Aug 13:20 kde4_user_preKDEstart.sh -> /home/kde4_user_preKDEstart.sh*

With KDE5/plasma the location may have been moved to ‘$HOME/.config/plasma-workspace/env’.

@korrode: My text in my previous post is only partly directed to you: the example X.Org Zaphod configuration and the KDE Bug #324483.
The rest is for general information only (I forgot to re-read your original post!) :shame:

I just installed Gnome 3 to see how it handles the situation. It does basically exactly what i want OOTB:rolleyes:

I just wish Gnome had desktop switching like Compiz’s Expo and KWin’s Grid.

Yes, despite my preference for KDE, I have to admit that currently KDE does have some rather unpleasant issues and, this thread has raised yet another one.