0

Anyone know how to use environment variables or something similar in an LXSession autostart file? My initial attempts seem to have failed :-(. I'm creating a Chromium kiosk noticeboard and need an easy way to configure the website and don't want to have users editing the LXSession autostart file directly.

2 Answers 2

0

Could not make this work directly but the launching a shell script from within the autostart file does work and it can contain environment variables. However remember to launch via a shell so...

# In .../autostart place this @/bin/bash /usr/bin/script_with_env_vars.sh # # Calling directly will not work @/usr/bin/script_with_env_vars.sh - fails!!! 
1
  • unfortunately a subprocess set variables only for itself and its children. It doesn't affect the parent environment. Commented Nov 25, 2020 at 17:07
0

The way to do it is with .xinitrc. Notice if .xinitrc exists, its responsible to start the desktop environment (startlxde/startkde/...). I tried to just set TERM and exit and my XDE login just crashed.

#!/bin/bash export TERM=linux exec startlxde 

Trying to run a child process to set the environment is futile as it happily changes its own environment then exit, leaving the parent process environment unchanged.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.