I'm trying to find a good and reliable way to configure my system to source files like

  • /etc/environment
  • /etc/environment.d/*
  • /etc/profile
  • /etc/profile.d/*
  • ~/.profile

on system start or login. I'm using the default Kali configuration with LightDM and XFCE. As far as I found out, the files aren't sourced, because there isn't a login shell involved in the start and login process. Therefore, LightDM usually uses scripts like /etc/lightdm/Xsession or /etc/lightdm/Xsession.d as wrapper scripts to configure the mentioned configuration files. Arch Linux describes it here:


I can't find these files in the default Kali installation, and I can't find any examples for these files online. Probably I'm able to write a basic script, but it would consider all the edge cases, best practices and common configuration files.

Many packages expect the system to source these files, e.g. deno or npm. They add their necessary configuration there.

How would I solve this problem? Is there an example configuration for this?