0

Which file(s) assigns the preset Environment variables listed by bash printenv or env on Lubuntu (LXQt & LXDE, if they are different)? Are the same files used for other:

  • Debian-based distros
  • Non-Debian distros (Red Hat family, Arch)

TIA!

2 Answers2

0

most of them are defined in relevant files in the /etc directory. running grep -r ^[[:upper:]] /etc/* must list most of them. a few particularly interesting files according to the Ubuntu documentation are:

  1. /etc/environment: documentation states

"...This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of assignment expressions, one per line..."

  1. files in the /etc/profile.d directory ending in .sh. documentation states:

"...An alternative is to create a file for the purpose in the /etc/profile.d directory... Files with the .sh extension in the /etc/profile.d directory get executed whenever a bash login shell is entered (e.g. when logging in from the console or over ssh), as well as by the DisplayManager when the desktop session loads..."

terdon
  • 100,812
0

In LXQt, a good place to set environment variables for programs you will launch from the menu is in the session settings; these are located in the INI-style file ~/.config/lxqt/session.conf, in the [Environment] section. You can also configure them in the GUI under Preferences -> LXQt Settings -> Session Settings, where you will find the list in the Environment page. Double click on the lines in the list to edit the text.

In general, processes inherit their environments from the process that launched them, they can make additional changes to their own environment, and then they pass those changes on to processes they launch. This is the reason why where you make the change (in effect, what process(es) you are changing the environment in) may have different answers depending on how you launch the program that you want to give the environment variable you are trying to set.

rakslice
  • 173