#!/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."