Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Preserving UNIX environment variable in a session?

13 views
Skip to first unread message

Marcin Cieślak

unread,
Sep 26, 2012, 7:30:37 AM9/26/12
to
Hello,

I am currently playing a bit with the recently
open sourced Common Desktop Enviroment [1].
CDE has a standard session manager, using X Session
Manager Protocol.

For some applications I am setting up some environment
variables, for example my rxvt-unicode (urxvt) is
started as "env LANG=pl_PL.UTF-8 /usr/local/bin/urxvt"
and my browsers need HTTP_PROXY and FTP_PROXY variables
to work (for example it's the only way to set proxy
for my Chrome).

After the session gets restarted upon login, those
application start but the environment is not preserved
(by design). I would like to avoid restarting those
clients only because of missing environment.

I understand that XSMP is fully client-driven, but
is there any way to solve this issue? Maybe the
window manager could save some data from the client
environment?

Do you know how other X "desktop environments" are
dealing with this problem?

[1] http://cdesktopenv.sourceforge.net

//Marcin

Dario Niedermann

unread,
Oct 1, 2012, 4:07:44 PM10/1/12
to
Marcin Cieślak <sa...@sgh.waw.pl> wrote:

> For some applications I am setting up some environment
> variables, for example my rxvt-unicode (urxvt) is
> started as "env LANG=pl_PL.UTF-8 /usr/local/bin/urxvt"
> and my browsers need HTTP_PROXY and FTP_PROXY variables
> to work (for example it's the only way to set proxy
> for my Chrome).
>
> After the session gets restarted upon login, those
> application start but the environment is not preserved
> (by design). I would like to avoid restarting those
> clients only because of missing environment.

Why don't you setup the environment in your ~/.xinitrc or ~/.xsession
files? They're just regular `sh' scripts that are sourced upon X11
startup.

--
> head -n1 /etc/*-{version,release} && uname -mprs
Slackware 12.1.0
Linux 2.6.24.5-smp i686 AMD Turion(tm) 64 Mobile Technology MK-36

Richard Tobin

unread,
Oct 2, 2012, 7:51:05 AM10/2/12
to
In article <slrnk6ju0g...@dnied-at-tiscali.it>,
Dario Niedermann <dn...@tiscali.it> wrote:
>> For some applications I am setting up some environment
>> variables, for example my rxvt-unicode (urxvt) is
>> started as "env LANG=pl_PL.UTF-8 /usr/local/bin/urxvt"

>Why don't you setup the environment in your ~/.xinitrc or ~/.xsession
>files? They're just regular `sh' scripts that are sourced upon X11
>startup.

Presumably he doesn't want all his program to have the same
environment. One solution is to make a shell script wrapper for each
program that needs environment variables set.

-- Richard
0 new messages