diff --git a/README.md b/README.md index 8d22d32..ace978f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,9 @@ It runs these steps, in this order, and every one of them is idempotent: Step 8 is the one a plain Arch install cannot do without: SDDM's stock Wayland greeter runs on `weston`, which Blob does not install, so the greeter is pointed -at Hyprland instead. [install.md](docs/install.md) covers each step in full. +at Hyprland instead. It also reports any leftover drop-in that autologs into a +session that is not installed, which is what a black screen with no login prompt +usually is. [install.md](docs/install.md) covers each step in full. To back out, `./uninstall.sh` removes the session entry, the config, the user services, and the symlink, restoring any `.bak` the installer made. The diff --git a/default/sddm/hyprland-greeter.conf b/default/sddm/hyprland-greeter.conf new file mode 100644 index 0000000..e24cdac --- /dev/null +++ b/default/sddm/hyprland-greeter.conf @@ -0,0 +1,9 @@ +misc { + disable_hyprland_logo = true + disable_splash_rendering = true + force_default_wallpaper = 0 +} + +animations { + enabled = false +} diff --git a/default/sddm/hyprland-greeter.lua b/default/sddm/hyprland-greeter.lua deleted file mode 100644 index 14d8870..0000000 --- a/default/sddm/hyprland-greeter.lua +++ /dev/null @@ -1,11 +0,0 @@ -hl.config({ - misc = { - disable_hyprland_logo = true, - disable_splash_rendering = true, - force_default_wallpaper = 0, - }, - - animations = { - enabled = false, - }, -}) diff --git a/default/sddm/10-blob.conf b/default/sddm/zz-blob.conf similarity index 73% rename from default/sddm/10-blob.conf rename to default/sddm/zz-blob.conf index 671e75e..4c7d7d4 100644 --- a/default/sddm/10-blob.conf +++ b/default/sddm/zz-blob.conf @@ -2,7 +2,14 @@ DisplayServer=wayland [Wayland] -CompositorCommand=start-hyprland -- --config /etc/sddm/hyprland-greeter.lua +CompositorCommand=start-hyprland -- --config /etc/sddm/hyprland-greeter.conf + +[Theme] +Current= + +[Autologin] +User= +Session= [Users] RememberLastUser=true diff --git a/docs/install.md b/docs/install.md index 5e4b4f9..8f7606b 100644 --- a/docs/install.md +++ b/docs/install.md @@ -43,14 +43,33 @@ with `--check`. | File | Why | | --- | --- | | `/usr/local/share/wayland-sessions/blob.desktop` | the session SDDM offers | - | `/etc/sddm.conf.d/10-blob.conf` | Wayland greeter, run on Hyprland, remember the last session | - | `/etc/sddm/hyprland-greeter.lua` | the greeter's own tiny Hyprland config | + | `/etc/sddm.conf.d/zz-blob.conf` | Wayland greeter, run on Hyprland, stock theme, remember the last session | + | `/etc/sddm/hyprland-greeter.conf` | the greeter's own tiny Hyprland config | The greeter config matters more than it looks: SDDM's stock Wayland greeter runs on `weston`, which Blob does not install, so a default SDDM would fail to draw anything. `sddm.service` is enabled and the default systemd target is set to `graphical.target`, which an Arch install without a display manager does not have. + + The `zz-` prefix is load-bearing. SDDM reads `/etc/sddm.conf.d` in + alphabetical order and the last file wins, so a leftover `10-wayland.conf`, + `10-theme.conf` or `autologin.conf` from another desktop would otherwise + override Blob's. For the same reason `zz-blob.conf` blanks `Theme` and + `Autologin`: a greeter pointed at an uninstalled theme, or an autologin + pointed at a session entry that no longer exists, leaves SDDM on a black + screen it never falls back from, and the only way in is a TTY. + + The Omarchy ISO wrote exactly such an autologin, owned by no package, so it + outlives Omarchy. The installer reports it and overrides it; deleting it stops + the warning: + + ```bash + sudo rm /etc/sddm.conf.d/autologin.conf + ``` + + `--autologin` writes `zzz-blob-autologin.conf`, the only file that sorts after + `zz-blob.conf`. 9. **Launch.** When the installer was run from a console and nothing graphical is running, it starts `sddm.service` so the desktop appears without a reboot. `--no-launch` prints the command instead. `--autologin` writes diff --git a/install.sh b/install.sh index ec6b709..b8fd5ef 100755 --- a/install.sh +++ b/install.sh @@ -74,6 +74,7 @@ install_login_config install_session_entry install_autologin enable_display_manager +report_login_conflicts say "" if [[ $check == true ]]; then diff --git a/install/steps/login.sh b/install/steps/login.sh index 7fd3f21..c1989c9 100644 --- a/install/steps/login.sh +++ b/install/steps/login.sh @@ -1,13 +1,21 @@ session_entry_dir=/usr/local/share/wayland-sessions -greeter_compositor_config=/etc/sddm/hyprland-greeter.lua +session_entry_search_dirs=(/usr/local/share/wayland-sessions /usr/share/wayland-sessions) +greeter_config_dir=/etc/sddm.conf.d +greeter_compositor_config=/etc/sddm/hyprland-greeter.conf + +# SDDM reads /etc/sddm.conf.d in alphabetical order and the last file wins, so +# Blob's drop-ins are named to sort after anything a distribution, an installer +# ISO, or a previous desktop left behind. +blob_greeter_conf="$greeter_config_dir/zz-blob.conf" +blob_autologin_conf="$greeter_config_dir/zzz-blob-autologin.conf" # SDDM's stock Wayland greeter runs on weston, which Blob does not install. # Point it at Hyprland with a greeter-only config instead. install_login_config() { - install_root_file "$repo_dir/default/sddm/hyprland-greeter.lua" \ - "$greeter_compositor_config" "sddm/hyprland-greeter.lua" - install_root_file "$repo_dir/default/sddm/10-blob.conf" \ - /etc/sddm.conf.d/10-blob.conf "sddm.conf.d/10-blob.conf" + install_root_file "$repo_dir/default/sddm/hyprland-greeter.conf" \ + "$greeter_compositor_config" "sddm/hyprland-greeter.conf" + install_root_file "$repo_dir/default/sddm/zz-blob.conf" \ + "$blob_greeter_conf" "sddm.conf.d/zz-blob.conf" } install_session_entry() { @@ -23,11 +31,54 @@ install_autologin() { local generated generated="$(mktemp)" printf '[Autologin]\nUser=%s\nSession=blob.desktop\n' "$USER" >"$generated" - install_root_file "$generated" \ - /etc/sddm.conf.d/99-blob-autologin.conf "sddm.conf.d/99-blob-autologin.conf" + install_root_file "$generated" "$blob_autologin_conf" "sddm.conf.d/zzz-blob-autologin.conf" rm -f "$generated" } +session_entry_exists() { + local entry="$1" + local dir + + for dir in "${session_entry_search_dirs[@]}"; do + [[ -e $dir/$entry ]] && return 0 + done + + return 1 +} + +setting_value() { + local file="$1" key="$2" + + sed -n "s/^[[:space:]]*$key[[:space:]]*=[[:space:]]*//p" "$file" | tail -1 +} + +# zz-blob.conf blanks Theme and Autologin, so a leftover drop-in cannot point the +# greeter at a theme that was uninstalled or autolog into a session that no +# longer exists. Either one leaves SDDM on a black screen it never falls back +# from. Report the leftovers anyway: the file is confusing to find later, and the +# Omarchy ISO wrote an autologin that no package owns, so it outlives Omarchy. +report_login_conflicts() { + local file session + local found=false + + for file in "$greeter_config_dir"/*.conf; do + [[ -e $file ]] || continue + [[ $file == "$blob_greeter_conf" || $file == "$blob_autologin_conf" ]] && continue + + session="$(setting_value "$file" Session)" + [[ -n $session ]] || continue + session_entry_exists "$session" && continue + + found=true + say "WARN $file autologs into $session, which is not installed" + done + + if [[ $found == true ]]; then + say " Blob's config overrides it, so the greeter still comes up." + say " Delete the file to stop it coming back." + fi +} + # Enabling sddm is not enough on a machine installed without a display manager: # its default target is multi-user.target, which never pulls in graphical.target. enable_display_manager() { diff --git a/uninstall.sh b/uninstall.sh index ea25031..c2b5e97 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -7,6 +7,9 @@ config_dir="$HOME/.config" session_entry="/usr/local/share/wayland-sessions/blob.desktop" root_files=( + /etc/sddm.conf.d/zz-blob.conf + /etc/sddm.conf.d/zzz-blob-autologin.conf + /etc/sddm/hyprland-greeter.conf /etc/sddm.conf.d/10-blob.conf /etc/sddm.conf.d/99-blob-autologin.conf /etc/sddm/hyprland-greeter.lua