fix autologin work on non X11 kde6
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@ -69,17 +69,38 @@ if [[ -z $SENTINEL_CREATED ]]; then
|
|||||||
export SENTINEL_CREATED=1
|
export SENTINEL_CREATED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /usr/share/xsessions/plasmax11.desktop ]]; then
|
KDE6=""
|
||||||
version=$(grep -E '^X-KDE-PluginInfo-Version=' /usr/share/xsessions/plasmax11.desktop | cut -d'=' -f2)
|
HAS_KDE_X11=""
|
||||||
if [[ $version =~ ^6.* ]]; then
|
KDE_VERSION=""
|
||||||
KDE6="true"
|
|
||||||
|
for file in \
|
||||||
|
/usr/share/xsessions/plasmax11.desktop \
|
||||||
|
/usr/share/wayland-sessions/plasma.desktop \
|
||||||
|
/usr/share/wayland-sessions/plasmawayland.desktop \
|
||||||
|
/usr/share/xsessions/plasmax.desktop; do
|
||||||
|
|
||||||
|
if [[ -f "$file" ]]; then
|
||||||
|
version=$(grep -E '^X-KDE-PluginInfo-Version=' "$file" | cut -d'=' -f2)
|
||||||
|
if [[ -n "$version" ]]; then
|
||||||
|
KDE_VERSION="$version"
|
||||||
|
break
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$KDE_VERSION" && "${KDE_VERSION%%.*}" -ge 6 ]]; then
|
||||||
|
KDE6="true"
|
||||||
|
else
|
||||||
|
KDE6=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f /usr/share/xsessions/plasmax11.desktop ]]; then
|
||||||
|
HAS_KDE_X11="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
de_normalized="${DE,,}"
|
de_normalized="${DE,,}"
|
||||||
|
|
||||||
# TODO: Check ALT Workstation session_launcher
|
# TODO: Check ALT Workstation session_launcher
|
||||||
|
|
||||||
case "$session" in
|
case "$session" in
|
||||||
desktop)
|
desktop)
|
||||||
if [[ "$SESSION_TYPE" == "wayland" ]]; then
|
if [[ "$SESSION_TYPE" == "wayland" ]]; then
|
||||||
@ -88,8 +109,11 @@ case "$session" in
|
|||||||
elif [[ "$de_normalized" == *gnome* ]]; then
|
elif [[ "$de_normalized" == *gnome* ]]; then
|
||||||
session_launcher="gnome-wayland"
|
session_launcher="gnome-wayland"
|
||||||
elif [[ "$de_normalized" == *kde* ]]; then
|
elif [[ "$de_normalized" == *kde* ]]; then
|
||||||
session_launcher="plasma"
|
if [[ "$KDE6" == "true" ]]; then
|
||||||
[[ "$KDE6" != "true" ]] && session_launcher="plasmawayland"
|
session_launcher="plasma"
|
||||||
|
else
|
||||||
|
session_launcher="plasmawayland"
|
||||||
|
fi
|
||||||
elif [[ "$de_normalized" == *hyprland* ]]; then
|
elif [[ "$de_normalized" == *hyprland* ]]; then
|
||||||
session_launcher="hyprland"
|
session_launcher="hyprland"
|
||||||
elif [[ "$de_normalized" == *xfce* && "$de_normalized" != *unicorn* ]]; then
|
elif [[ "$de_normalized" == *xfce* && "$de_normalized" != *unicorn* ]]; then
|
||||||
@ -101,8 +125,15 @@ case "$session" in
|
|||||||
elif [[ "$de_normalized" == *gnome* ]]; then
|
elif [[ "$de_normalized" == *gnome* ]]; then
|
||||||
session_launcher="gnome-xorg"
|
session_launcher="gnome-xorg"
|
||||||
elif [[ "$de_normalized" == *kde* ]]; then
|
elif [[ "$de_normalized" == *kde* ]]; then
|
||||||
session_launcher="plasmax11"
|
if [[ "$KDE6" == "true" ]]; then
|
||||||
[[ "$KDE6" != "true" ]] && session_launcher="plasma"
|
if [[ "$HAS_KDE_X11" == "true" ]]; then
|
||||||
|
session_launcher="plasmax11"
|
||||||
|
else
|
||||||
|
die "KDE6 detected, but plasmax11 (X11 session) not available"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
session_launcher="plasma"
|
||||||
|
fi
|
||||||
elif [[ "$de_normalized" == *mate* ]]; then
|
elif [[ "$de_normalized" == *mate* ]]; then
|
||||||
session_launcher="mate"
|
session_launcher="mate"
|
||||||
elif [[ "$de_normalized" == *unicorn* ]]; then
|
elif [[ "$de_normalized" == *unicorn* ]]; then
|
||||||
|
Reference in New Issue
Block a user