Skip to content

Commit 335ad1a

Browse files
committed
Set XDG_CURRENT_DESKTOP for new units started by user service manager
This fixes the problem that XDG Desktop Portal does not use the LXQt backend under LXQt session.
1 parent 6caf02e commit 335ad1a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

startlxqtwayland.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ done
8383

8484
export XDG_CURRENT_DESKTOP="LXQt:$COMPOSITOR:wlroots"
8585

86+
# set environment variables for new units started by user service manager
87+
if command -v systemctl >/dev/null; then
88+
systemctl --user import-environment XDG_CURRENT_DESKTOP
89+
fi
90+
8691
valid_layouts=$(grep -A98 '! layout' /usr/share/X11/xkb/rules/base.lst | awk '{print $1}' | grep -v '!')
8792
trylayout=$(echo $LANG | cut -c 1,2)
8893

@@ -91,6 +96,11 @@ if [ -z "$COMPOSITOR" ]; then
9196
COMPOSITOR=labwc
9297
export XDG_CURRENT_DESKTOP="LXQt:wlroots"
9398

99+
# set environment variables for new units started by user service manager
100+
if command -v systemctl >/dev/null; then
101+
systemctl --user import-environment XDG_CURRENT_DESKTOP
102+
fi
103+
94104
# enable cursor on VM (systemd only)
95105
if type systemd-detect-virt > /dev/null 2>&1 && systemd-detect-virt --quiet; then
96106
export WLR_NO_HARDWARE_CURSORS=1
@@ -125,6 +135,12 @@ elif [ "$COMPOSITOR" = "kwin_wayland" ]; then
125135
# Style KDE's QML apps like systemsettings
126136
export QT_QUICK_CONTROLS_STYLE=org.kde.desktop
127137
export XDG_CURRENT_DESKTOP="LXQt:$COMPOSITOR"
138+
139+
# set environment variables for new units started by user service manager
140+
if command -v systemctl >/dev/null; then
141+
systemctl --user import-environment XDG_CURRENT_DESKTOP
142+
fi
143+
128144
if echo "$valid_layouts" | grep -q "$trylayout"; then
129145
kxkbrc=$XDG_CONFIG_HOME/kxkbrc
130146
layout="LayoutList=$trylayout"

0 commit comments

Comments
 (0)