Monorepo for Aesthetic.Computer aesthetic.computer
at main 200 lines 5.7 kB view raw
1#!/bin/bash 2# install.sh — Set up FedAC on an existing Fedora Workstation installation 3# 4# Run as root (or via sudo) on a fresh Fedora install: 5# sudo bash fedac/scripts/install.sh 6# 7# What it does: 8# 1. Installs dependencies (fish, fuse, etc.) 9# 2. Downloads AC Electron AppImage 10# 3. Configures GDM auto-login 11# 4. Installs Plymouth boot splash (pals) 12# 5. Sets up GNOME kiosk settings (no lock, no sleep) 13# 6. Installs ac-setup TUI on tty2 14# 7. Creates autostart entry for AC Electron 15 16set -euo pipefail 17 18SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 19FEDAC_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" 20AC_USER="${AC_USER:-me}" 21 22RED='\033[0;31m' 23GREEN='\033[0;32m' 24CYAN='\033[0;36m' 25NC='\033[0m' 26 27step() { echo -e "\n${CYAN}[$1] $2${NC}"; } 28 29# Must be root 30if [ "$(id -u)" -ne 0 ]; then 31 echo -e "${RED}Error: Run as root (sudo bash fedac/scripts/install.sh)${NC}" 32 exit 1 33fi 34 35# Check Fedora 36if ! [ -f /etc/fedora-release ]; then 37 echo -e "${RED}Warning: This doesn't look like Fedora. Proceeding anyway...${NC}" 38fi 39 40# ── 1. Install packages ── 41step 1 "Installing packages..." 42dnf install -y \ 43 fish \ 44 git \ 45 htop \ 46 curl \ 47 wget \ 48 unzip \ 49 python3 \ 50 python3-pip \ 51 fuse \ 52 fuse-libs \ 53 plymouth \ 54 NetworkManager \ 55 NetworkManager-wifi \ 56 mesa-dri-drivers \ 57 mesa-vulkan-drivers \ 58 xdg-utils 59 60# ── 2. Set fish as default shell ── 61step 2 "Setting fish as default shell for $AC_USER..." 62chsh -s /usr/bin/fish "$AC_USER" 2>/dev/null || true 63 64# ── 3. Download AC Electron ── 65step 3 "Installing AC Electron..." 66mkdir -p /opt/ac/bin 67if [ -f "$FEDAC_DIR/overlays/ac-electron-kiosk/install-electron.sh" ]; then 68 bash "$FEDAC_DIR/overlays/ac-electron-kiosk/install-electron.sh" 69else 70 echo "install-electron.sh not found, skipping AppImage download." 71 echo "Place AppImage at /opt/ac/bin/aesthetic-computer.AppImage manually." 72fi 73 74# ── 4. Configure GDM auto-login ── 75step 4 "Configuring GDM auto-login..." 76mkdir -p /etc/gdm 77cat > /etc/gdm/custom.conf << GDMEOF 78[daemon] 79AutomaticLoginEnable=True 80AutomaticLogin=$AC_USER 81WaylandEnable=true 82 83[security] 84AllowRoot=false 85 86[xdmcp] 87 88[chooser] 89GDMEOF 90 91# ── 5. Install Plymouth theme ── 92step 5 "Installing Plymouth boot splash..." 93PLYMOUTH_DIR="/usr/share/plymouth/themes/fedac" 94mkdir -p "$PLYMOUTH_DIR" 95 96# Copy theme files 97if [ -d "$FEDAC_DIR/plymouth" ]; then 98 cp "$FEDAC_DIR/plymouth/fedac.plymouth" "$PLYMOUTH_DIR/" 99 cp "$FEDAC_DIR/plymouth/fedac.script" "$PLYMOUTH_DIR/" 100 101 # Copy pals.png (check multiple locations) 102 if [ -f "$FEDAC_DIR/plymouth/pals.png" ]; then 103 cp "$FEDAC_DIR/plymouth/pals.png" "$PLYMOUTH_DIR/" 104 elif [ -f "$FEDAC_DIR/../system/public/assets/direct/pals.png" ]; then 105 cp "$FEDAC_DIR/../system/public/assets/direct/pals.png" "$PLYMOUTH_DIR/" 106 else 107 echo "WARNING: pals.png not found. Plymouth theme will be incomplete." 108 fi 109 110 plymouth-set-default-theme fedac 2>/dev/null || true 111 # Rebuild initramfs with new theme 112 dracut -f 2>/dev/null || true 113 echo "Plymouth theme installed." 114else 115 echo "Plymouth theme files not found, skipping." 116fi 117 118# ── 6. GNOME kiosk settings ── 119step 6 "Configuring GNOME for kiosk mode..." 120 121# dconf profile 122mkdir -p /etc/dconf/profile 123cat > /etc/dconf/profile/user << 'DCONFEOF' 124user-db:user 125system-db:local 126DCONFEOF 127 128# dconf system settings 129mkdir -p /etc/dconf/db/local.d 130cat > /etc/dconf/db/local.d/00-fedac << 'DCONFDBEOF' 131[org/gnome/desktop/session] 132idle-delay=uint32 0 133 134[org/gnome/desktop/screensaver] 135lock-enabled=false 136idle-activation-enabled=false 137 138[org/gnome/desktop/notifications] 139show-banners=false 140 141[org/gnome/settings-daemon/plugins/power] 142sleep-inactive-ac-type='nothing' 143sleep-inactive-battery-timeout=1800 144ambient-enabled=false 145DCONFDBEOF 146 147dconf update 2>/dev/null || true 148 149# ── 7. Autostart entry ── 150step 7 "Installing autostart entry..." 151AC_HOME=$(eval echo "~$AC_USER") 152mkdir -p "$AC_HOME/.config/autostart" 153 154if [ -f "$FEDAC_DIR/overlays/ac-electron-kiosk/ac-electron-kiosk.desktop" ]; then 155 cp "$FEDAC_DIR/overlays/ac-electron-kiosk/ac-electron-kiosk.desktop" \ 156 "$AC_HOME/.config/autostart/" 157else 158 cat > "$AC_HOME/.config/autostart/ac-electron-kiosk.desktop" << 'DESKTOPEOF' 159[Desktop Entry] 160Type=Application 161Name=Aesthetic Computer 162Exec=/opt/ac/bin/aesthetic-computer.AppImage --no-sandbox --kiosk 163Terminal=false 164X-GNOME-Autostart-enabled=true 165X-GNOME-Autostart-Delay=2 166DESKTOPEOF 167fi 168 169# ── 8. Install TUI on tty2 ── 170step 8 "Installing ac-setup TUI..." 171if [ -f "$FEDAC_DIR/overlays/ac-setup/ac-setup.py" ]; then 172 cp "$FEDAC_DIR/overlays/ac-setup/ac-setup.py" /opt/ac/bin/ac-setup 173 chmod +x /opt/ac/bin/ac-setup 174 ln -sf /opt/ac/bin/ac-setup /usr/local/bin/ac-setup 175 176 # Systemd service to auto-run TUI on tty2 177 if [ -f "$FEDAC_DIR/systemd/ac-setup-tty.service" ]; then 178 cp "$FEDAC_DIR/systemd/ac-setup-tty.service" /etc/systemd/system/ 179 systemctl daemon-reload 180 systemctl enable ac-setup-tty.service 181 fi 182fi 183 184# ── 9. Fix ownership ── 185step 9 "Fixing ownership..." 186chown -R "$AC_USER:$AC_USER" "$AC_HOME" 187chown -R "$AC_USER:$AC_USER" /opt/ac 188 189# ── Done ── 190echo "" 191echo -e "${GREEN}=== FedAC installed ===${NC}" 192echo "" 193echo "Next steps:" 194echo " 1. Reboot to see the pals boot splash" 195echo " 2. System will auto-login as '$AC_USER'" 196echo " 3. AC Electron will launch fullscreen" 197echo " 4. Press Ctrl+Alt+F2 for the setup TUI" 198echo " 5. Press Ctrl+B in AC to flip to terminal" 199echo "" 200echo "To re-run this script: sudo bash fedac/scripts/install.sh"