What's the best way to set environment variable on SDDM

Hello everyone.

After installing KDE Plasma from source, I was told to set several environment variables for the session to work (QT_PLUGIN_PATH, QT_QUICK_CONTROLS_STYLE_PATH, QML2_IMPORT_PATH, etc), because I installed it in /usr/local.

And indeed, the X/Wayland session work, but the breeze theme in SDDM, cannot be loaded…
I see red error messages that goes :

The current theme cannot be loaded due to the errors below, please select another theme.

file:///usr/local/share/sddm/themes/breeze/Main.qml:14:1: module “org.kde.plasma.extras” is not installed
file:///usr/local/share/sddm/themes/breeze/Main.qml:13:1: module “org.kde.plasma.components” is not installed

…and so on…

I know it’s due to the QML modules couldn’t be imported due to them being not searched at their correct location, but setting the environment variables in /etc/profile did not help

Could you tell me where’s the best place to set the KDE installation env vars in general, so it works with SDDM ?

I use Debian, BTW :slight_smile:

Profile.d. Should work. Can you paste what you did?

Sure. Here’s what I append to the end of /etc/profile :
It’s pretty basic.

export QT_PLUGIN_PATH=/usr/local/lib/x86_64-linux-gnu/plugins:/usr/lib/x86_64-linux-gnu/qt5/plugins
export QT_QUICK_CONTROLS_STYLE_PATH=/usr/local/lib/x86_64-linux-gnu/qml/QtQuick/Controls.2:/usr/lib/x86_64-linux-gnu/qt5/qml/QtQuick/Controls.2
export QML2_IMPORT_PATH=/usr/local/lib/x86_64-linux-gnu/qml:/usr/lib/x86_64-linux-gnu/qt5/qml

These are all the environment variables I have to set, given my install prefix is /usr/local/.