Restructure for bare Fedora: lib/ + modules/, DE selection restored

Splits setup.sh into lib/common.sh, lib/session.sh and seven modules
(3 DE, 4 TWM). Targets a bare Fedora 44+ install.

Fixes carried over from the first build:
- DEBUG_MODE was unbound under set -u, aborting the script at the version banner
- mangled 'echohttps://...' line left over from the starburst split
- set -e was missing entirely; --debug flag parsing restored
- unguarded 'clear' aborted the run without TERM
- $PRETTY_NAME unguarded under set -u
- modules were sourced, leaking shell options into the parent
- Flathub added twice (system-wide + per-user)
- no dnf5-plugins check before using 'dnf config-manager'
- no Fedora release gate
- /usr/share/xsessions assumed to exist when writing session entries
This commit is contained in:
Pathfinder
2026-10-27 10:15:04 +01:00
parent 4f59afbac1
commit 234bf8214e
11 changed files with 973 additions and 220 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=../../lib/common.sh
source "$HERE/../../lib/common.sh"
# shellcheck source=../../lib/session.sh
source "$HERE/../../lib/session.sh"
if is_debug; then set +e; else set -e; fi
step "Desktop environment: GNOME"
rule
if pkg_installed gnome-shell; then
ok "GNOME already installed."
else
info "Installing the GNOME desktop..."
# Group names have shifted across releases; take whichever exists.
install_group_any gnome-desktop gnome-desktop-environment workstation-product-environment
install_optional gnome-tweaks gnome-extensions-app
fi
# GNOME ships and enables gdm itself. We deliberately leave it alone: a DE module
# never fights the DE over its own greeter. A TWM module switched on top will
# move the system to SDDM instead.
info "Current display manager: $(detect_display_manager)"
ok "GNOME setup complete."
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=../../lib/common.sh
source "$HERE/../../lib/common.sh"
# shellcheck source=../../lib/session.sh
source "$HERE/../../lib/session.sh"
if is_debug; then set +e; else set -e; fi
step "Desktop environment: KDE Plasma"
rule
if pkg_installed plasma-workspace; then
ok "Plasma already installed."
else
info "Installing the KDE Plasma desktop..."
install_group_any kde-desktop kde-desktop-environment
fi
# Plasma's native greeter is SDDM; make sure it is actually the active one.
install_packages sddm
switch_display_manager sddm
ok "Plasma setup complete."
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=../../lib/common.sh
source "$HERE/../../lib/common.sh"
# shellcheck source=../../lib/session.sh
source "$HERE/../../lib/session.sh"
if is_debug; then set +e; else set -e; fi
step "Desktop environment: XFCE"
rule
if pkg_installed xfce4-session; then
ok "XFCE already installed."
else
info "Installing the XFCE desktop..."
install_group_any xfce-desktop xfce-desktop-environment
install_optional "@xfce-extra-plugins"
fi
# XFCE is X11. It needs an X server present even when it is only the session
# provider for chadwm.
install_packages xorg-x11-server-Xorg xorg-x11-xinit
# XFCE's native greeter is lightdm
if ! pkg_installed lightdm; then
install_packages lightdm
fi
switch_display_manager lightdm
install_nerd_font JetBrainsMono
install_packages alacritty dconf
# Point XFCE's terminal preference at alacritty, seeding the config directly so
# it applies on first login rather than needing a session restart.
XFCONF_DIR="$HOME/.config/xfce4/xfconf/xfce-perchannel-xml"
mkdir -p "$XFCONF_DIR"
info "Seeding XFCE session defaults..."
cat > "$XFCONF_DIR/xfce4-session.xml" <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-session" version="1.0">
<property name="general" type="empty">
<property name="TerminalEmulator" type="string" value="alacritty"/>
</property>
</channel>
EOF
ok "XFCE setup complete."
+64
View File
@@ -0,0 +1,64 @@
#!/bin/bash
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=../../lib/common.sh
source "$HERE/../../lib/common.sh"
# shellcheck source=../../lib/session.sh
source "$HERE/../../lib/session.sh"
if is_debug; then set +e; else set -e; fi
step "Tiling window manager: chadwm"
rule
# chadwm is an X11 dwm fork and is not packaged for Fedora anywhere. It is
# built from source. Note this is the only non-Wayland option in the menu.
info "Installing chadwm build dependencies..."
install_packages \
gcc make git \
libX11-devel libXft-devel libXinerama-devel imlib2-devel \
dash xsetroot feh picom rofi alacritty \
xorg-x11-server-Xorg xorg-x11-xinit
CHAD_DIR="$HOME/.config/chadwm"
if [[ ! -d "$CHAD_DIR/.git" ]]; then
info "Cloning chadwm into $CHAD_DIR..."
git clone --depth 1 https://github.com/siduck/chadwm "$CHAD_DIR"
else
ok "chadwm source already present at $CHAD_DIR"
fi
if [[ ! -x /usr/local/bin/chadwm ]]; then
info "Building and installing chadwm..."
# make install needs root to write /usr/local/bin
sudo make -C "$CHAD_DIR/chadwm" install
else
ok "chadwm binary already installed."
fi
# Session wrapper: dwm forks do not do autostart themselves, so set up the
# wallpaper/compositor here instead of leaving the user with an empty desktop.
info "Installing session wrapper /usr/local/bin/chadwm-session..."
sudo tee /usr/local/bin/chadwm-session >/dev/null <<'EOF'
#!/bin/bash
# chadwm session: compositor + wallpaper + status, then hand over to chadwm.
pgrep -x picom >/dev/null || picom --daemon &
if [ -d "$HOME/Pictures" ]; then
feh --bg-fill "$(find "$HOME/Pictures" -maxdepth 1 -type f \
\( -iname '*.jpg' -o -iname '*.png' \) | head -n1)" 2>/dev/null || true
fi
xsetroot -cursor_name left_ptr 2>/dev/null || true
exec chadwm
EOF
sudo chmod 755 /usr/local/bin/chadwm-session
write_x11_session chadwm "chadwm" "/usr/local/bin/chadwm-session"
install_nerd_font JetBrainsMono
install_packages sddm
switch_display_manager sddm
ok "chadwm setup complete. Log out and pick chadwm in SDDM."
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=../../lib/common.sh
source "$HERE/../../lib/common.sh"
# shellcheck source=../../lib/session.sh
source "$HERE/../../lib/session.sh"
if is_debug; then set +e; else set -e; fi
step "Tiling window manager: Hyprland"
rule
info "Installing Hyprland and its ecosystem..."
install_packages hyprland xdg-desktop-portal-hyprland alacritty
install_packages hyprpaper hypridle hyprlock waybar mako
install_optional wofi
install_optional xwayland-satellite
install_session_prereqs
install_nerd_font JetBrainsMono
# The Fedora hyprland package ships hyprland.desktop in wayland-sessions.
install_packages sddm
switch_display_manager sddm
ok "Hyprland setup complete. Log out and pick Hyprland in SDDM."
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=../../lib/common.sh
source "$HERE/../../lib/common.sh"
# shellcheck source=../../lib/session.sh
source "$HERE/../../lib/session.sh"
if is_debug; then set +e; else set -e; fi
step "Tiling window manager: MangoWC"
rule
# MangoWC is not in the Fedora repos; it is packaged in Terra.
add_terra_repo
info "Installing MangoWC..."
if ! sudo dnf install -y mangowc; then
err "mangowc is not available from Terra on this release."
err "Alternatives: copr dennemann/MangoWC, or build from source:"
err " https://github.com/GravityShark/mangowc"
exit 1
fi
install_packages fuzzel alacritty
install_optional xdg-desktop-portal-wlr
install_optional xwayland-satellite
install_session_prereqs
install_nerd_font JetBrainsMono
# MangoWC's session entry is not guaranteed by the package; write one if absent.
write_wayland_session mangowc "MangoWC" "mangowc"
install_packages sddm
switch_display_manager sddm
ok "MangoWC setup complete. Log out and pick MangoWC in SDDM."
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=../../lib/common.sh
source "$HERE/../../lib/common.sh"
# shellcheck source=../../lib/session.sh
source "$HERE/../../lib/session.sh"
if is_debug; then set +e; else set -e; fi
step "Tiling window manager: Niri"
rule
# Noctalia (the shell you settled on) lives in the Terra repo.
add_terra_repo
info "Installing Niri + Noctalia..."
install_packages niri noctalia fuzzel alacritty
# niri is Wayland-only; this lets X11 apps run inside it
install_optional xwayland-satellite
install_optional xdg-desktop-portal-wlr
install_session_prereqs
install_nerd_font JetBrainsMono
# niri ships /usr/share/wayland-sessions/niri.desktop itself, so no entry needed.
install_packages sddm
switch_display_manager sddm
ok "Niri setup complete. Log out and pick Niri in SDDM."