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
65 lines
2.1 KiB
Bash
Executable File
65 lines
2.1 KiB
Bash
Executable File
#!/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."
|