TransWikia.com

Environment variable in LXSession autostart file?

Unix & Linux Asked by Paul D Smith on November 30, 2020

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

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.

Answered by Marcelo Pacheco on November 30, 2020

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!!!

Answered by Paul D Smith on November 30, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP