Open glyh opened 2 years ago
I don't think ly
attempts to load files from there. You can search the project for "environment.d" and you'll find no results.
This directory is page of systemd
and is documented here:
https://www.freedesktop.org/software/systemd/man/environment.d.html
Try systemctl --user show-environment
. If systemd
has read the file, you should see it reflected here, and those variables will be available to other systemd user services you launch.
GDM (GNOME Display Manager) uses D-Bus to import the user environment (see: https://github.com/GNOME/gdm/blob/b6bb2ccd6a5dec2d9a3be105996c55b502c611c8/daemon/gdm-wayland-session.c#L212)
We probably have to do the same to support this way of setting environment variables.
@glyph This is a systemd-only feature, so implementing it in Ly is pretty much a no-go. And @sylv-io, using D-Bus within Ly is pretty overkill in my opinion.
However, how do you guys feel about a config option in Ly that allows sourcing custom environment variables from an external file? Something like:
env_file = ~/.custom_env
ITYM @glyh
ITYM @glyh
Ah yes I do, haha!
and I don't want to source it from login shell
Doesn't Ly source the default shell profile before starting the window manager/wayland compositor anyway?
You don't need to source files under environment.d individually, the systemd environment generator can dump them in shell-compatible syntax.
set -a
eval "$(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)"
set +a
or for fish
export (/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
I store environmental variables there, but I don't see ly loading this. I can, fall back to
~/.pam_environment
, but this approach is deprecated, and I don't want to source it from login shell, so is there other approach to fix this?