Skip to content

Commit 282b9f6

Browse files
committed
install: keep display-manager selection consistent
1 parent 218165f commit 282b9f6

8 files changed

Lines changed: 35 additions & 12 deletions

File tree

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bench/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phantom-bench"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
edition = "2021"
55

66
[dependencies]

crates/client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phantom-client"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
edition = "2021"
55

66
[dependencies]

crates/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phantom-core"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
edition = "2021"
55

66
[features]

crates/gpu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phantom-gpu"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
edition = "2021"
55

66
[features]

crates/server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phantom-server"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
edition = "2021"
55

66
[features]

crates/web/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phantom-web"
3-
version = "0.5.4"
3+
version = "0.5.5"
44
edition = "2021"
55

66
[lib]

install.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ linux_install_light_gui_apt() {
465465
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
466466
xorg xfce4 lightdm xserver-xorg-video-dummy dbus-x11 x11-xserver-utils || true
467467

468+
echo "/usr/sbin/lightdm" | sudo tee /etc/X11/default-display-manager > /dev/null
468469
sudo mkdir -p /etc/lightdm/lightdm.conf.d
469470
sudo tee /etc/lightdm/lightdm.conf.d/50-phantom-xfce.conf > /dev/null <<'EOF'
470471
[Seat:*]
@@ -657,14 +658,34 @@ linux_configure_autologin() {
657658
}
658659

659660
linux_autologin_configure_display_manager() {
661+
_default_dm="$(basename "$(cat /etc/X11/default-display-manager 2>/dev/null || true)")"
662+
663+
if [ "$_default_dm" = "lightdm" ] \
664+
|| systemctl is-active --quiet lightdm 2>/dev/null \
665+
|| systemctl is-enabled --quiet lightdm 2>/dev/null; then
666+
linux_autologin_lightdm
667+
return 0
668+
fi
669+
670+
if [ "$_default_dm" = "gdm3" ] || [ "$_default_dm" = "gdm" ] \
671+
|| systemctl is-active --quiet gdm3 2>/dev/null \
672+
|| systemctl is-active --quiet gdm 2>/dev/null \
673+
|| systemctl is-enabled --quiet gdm3 2>/dev/null \
674+
|| systemctl is-enabled --quiet gdm 2>/dev/null; then
675+
linux_autologin_gdm
676+
return 0
677+
fi
678+
660679
if [ -d /etc/lightdm ] || [ -f /etc/lightdm/lightdm.conf ]; then
661680
linux_autologin_lightdm
662681
return 0
663682
fi
683+
664684
linux_autologin_gdm
665685
}
666686

667687
linux_autologin_lightdm() {
688+
echo "/usr/sbin/lightdm" | sudo tee /etc/X11/default-display-manager > /dev/null
668689
sudo mkdir -p /etc/lightdm/lightdm.conf.d
669690
sudo tee /etc/lightdm/lightdm.conf.d/60-phantom-autologin.conf > /dev/null <<EOF
670691
# Written by phantom install.sh --autologin
@@ -681,6 +702,7 @@ EOF
681702
linux_autologin_gdm() {
682703
# 1. GDM autologin (Ubuntu 22/24 default DM)
683704
if [ -f /etc/gdm3/custom.conf ]; then
705+
echo "/usr/sbin/gdm3" | sudo tee /etc/X11/default-display-manager > /dev/null
684706
# Back up original once so we can revert cleanly later
685707
if [ ! -f /etc/gdm3/custom.conf.phantom-bak ]; then
686708
sudo cp /etc/gdm3/custom.conf /etc/gdm3/custom.conf.phantom-bak
@@ -708,6 +730,7 @@ TimedLoginDelay = 5
708730
709731
[debug]
710732
EOF
733+
sudo systemctl enable gdm3 > /dev/null 2>&1 || true
711734
echo " Enabled GDM autologin for $TARGET_USER"
712735
else
713736
echo " WARN: /etc/gdm3/custom.conf not found. Only GDM is supported here — configure autologin manually for your DM."

0 commit comments

Comments
 (0)