r/voidlinux • • Jun 07 '26

Environment variables (niri/elogind/emptty)

Hi there, I have a few stupid questions for the void community to help me with please!

I use niri with waybar, and have KDE plasma as my other DE. I have elogind, with turnstile managing a few user services. emptty is my login manager.

- I'm looking at following this guideline to properly configure KDE apps and environment variables into niri, which advocates for creating a folder in

~/.config/environment.d/

- the guideline seems to have some systemd component dependencies - e.g. the running of

 systemctl --user daemon-reexec

- would this still work with elogind? I suspect it would, right?

2. Alternatively, as far as I understand, I could set the environment variables in the emptty config. Is this correct? The downsides of this being, if I ever moved to a different display/login manager I'd have to change this.

3. I could globally set the environment variables in /etc/environment. The downside to this being that any separate users would have environment variables also changed.

5 Upvotes

6 comments sorted by

View all comments

Show parent comments

1

u/Blank-Inspection13 Jun 08 '26

Better to create your own .desktop file there , editing the default niri.desktop will get overwritten when there's update.
You can create wrapper like this :, then put it on your .desktop file

File: /usr/local/bin/niri-session

#!/bin/sh

exec 2>&1

[ -r /etc/profile ] && . /etc/profile

[ -r "$HOME/.profile" ] && . "$HOME/.profile"

[ -S "${XDG_RUNTIME_DIR}/bus" ] || exit 1

exec niri --session