Fix the black screen on first boot and the installer's missing directories

This commit is contained in:
2026-09-20 13:18:03 -04:00
parent 421c58fab0
commit f00d09eb02
12 changed files with 181 additions and 48 deletions
+5
View File
@@ -1,6 +1,10 @@
# BLOB_PATH is a symlink to this checkout rather than a copy, so bin/, shell/,
# themes/ and default/ are always the working tree. Every path the shell
# resolves as $BLOB_PATH/... therefore needs no install step at all.
#
# ~/.local/share does not exist on a fresh Arch install, and ln does not create
# the parent of its link, so make it here rather than relying on another step
# having run first.
link_blob_path() {
local current=""
[[ -L $blob_path ]] && current="$(readlink -f "$blob_path")"
@@ -22,6 +26,7 @@ link_blob_path() {
return 0
fi
mkdir -p "$(dirname "$blob_path")"
ln -sfn "$repo_dir" "$blob_path"
say "link BLOB_PATH -> $repo_dir"
}
+1 -1
View File
@@ -17,7 +17,7 @@ directories=(
"$HOME/.local/share/fonts"
"$HOME/.local/share/applications"
"$HOME/.local/share/icons/hicolor/256x256/apps"
"$HOME/wallpapers"
"$HOME/.cache/blob"
)
create_directories() {
+6 -4
View File
@@ -1,7 +1,7 @@
session_entry_dir=/usr/local/share/wayland-sessions
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
greeter_compositor_config=/etc/sddm/hyprland-greeter.lua
# 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
@@ -10,10 +10,12 @@ 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.
# Point it at Hyprland with a greeter-only config instead. That config is Lua:
# Hyprland dropped the old hyprlang format, and a config it cannot parse leaves
# the greeter with no compositor and the screen black.
install_login_config() {
install_root_file "$repo_dir/default/sddm/hyprland-greeter.conf" \
"$greeter_compositor_config" "sddm/hyprland-greeter.conf"
install_root_file "$repo_dir/default/sddm/hyprland-greeter.lua" \
"$greeter_compositor_config" "sddm/hyprland-greeter.lua"
install_root_file "$repo_dir/default/sddm/zz-blob.conf" \
"$blob_greeter_conf" "sddm.conf.d/zz-blob.conf"
}
+92
View File
@@ -0,0 +1,92 @@
default_theme=flats
wallpaper_dir="$HOME/wallpapers"
current_state_dir="$HOME/.local/state/blob/current"
# ~/wallpapers is what the wallpaper picker and `blob wallpaper set` read, and
# the checkout already carries the collection. Link it for the same reason
# BLOB_PATH is a link: one copy, and edits in the checkout are live.
link_wallpapers() {
local source="$repo_dir/wallpapers"
local current=""
[[ -L $wallpaper_dir ]] && current="$(readlink -f "$wallpaper_dir")"
if [[ $current == "$source" ]]; then
say "ok wallpapers"
return 0
fi
if [[ -d $wallpaper_dir && ! -L $wallpaper_dir ]] && [[ -n "$(ls -A "$wallpaper_dir")" ]]; then
say "ok wallpapers (own directory kept)"
return 0
fi
note_change
if [[ $check == true ]]; then
say "would link $wallpaper_dir -> $source"
return 0
fi
[[ -d $wallpaper_dir && ! -L $wallpaper_dir ]] && rmdir "$wallpaper_dir"
ln -sfn "$source" "$wallpaper_dir"
say "link wallpapers -> $source"
}
# Without a theme there is no palette, no themed app config, and no background
# for the shell to draw, so the first login lands on a black screen that looks
# like a failed session. Applied headless: no shell and no session bus exist
# while the installer runs.
install_default_theme() {
if [[ -s $current_state_dir/theme.name ]]; then
say "ok theme ($(cat "$current_state_dir/theme.name"))"
return 0
fi
note_change
if [[ $check == true ]]; then
say "would apply the $default_theme theme"
return 0
fi
if BLOB_PATH="$blob_path" BLOB_THEME_HEADLESS=1 PATH="$repo_dir/bin:$PATH" \
blob-theme-set "$default_theme" >/dev/null; then
say "theme $default_theme"
else
say "WARN could not apply the $default_theme theme"
fi
}
# Only a theme that ships its own backgrounds/ sets this link, and most ship
# none: they are meant to leave the current wallpaper alone. On a first install
# there is no current wallpaper, so pick one.
install_default_background() {
local link="$current_state_dir/background"
local search="$wallpaper_dir"
local first
if [[ -e $link ]]; then
say "ok background"
return 0
fi
# --check writes nothing, so the wallpaper link is not there yet to look in.
[[ -d $search ]] || search="$repo_dir/wallpapers"
first="$(find -L "$search" -maxdepth 1 -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) \
2>/dev/null | sort | head -1)"
if [[ -z $first ]]; then
say "SKIP background (no image in $search)"
return 0
fi
note_change
if [[ $check == true ]]; then
say "would set the background to $(basename "$first")"
return 0
fi
ln -nsf "$first" "$link"
say "bg $(basename "$first")"
}