📦 deps(thirdparty): update snapshots

This commit is contained in:
ci[bot]
2026-07-29 07:59:17 +00:00
parent 60364c6660
commit 0c634043e3
427 changed files with 26138 additions and 2336 deletions
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Antigravity CLI Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,125 @@
# 🏔️ hyprfedora
> A safety-first agent skill that installs, configures, verifies, repairs, and removes Hyprland on Fedora Linux while preserving existing desktop packages and user backups.
---
## 🎯 Why This Project Exists
Setting up Hyprland on Fedora can be tedious. You have to configure Wayland portals, sort out PipeWire audio, select launcher/terminal defaults, and configure GPU flags—especially if you're running NVIDIA or hybrid graphics.
After installing this skill through your agent's supported skill mechanism, ask:
> **"Install Hyprland on my Fedora system."**
The agent inspects your system hardware, creates timestamped backups of existing settings, proposes Fedora package changes, and can create a minimal Hyprland configuration after you approve mutating steps. It detects GPU vendors but does not install or configure graphics drivers.
---
## ✨ Key Features
- 🛡️ **Safety First & Mandatory Backups**: Never overwrites your existing `~/.config/hypr/` without creating a timestamped backup in `~/.local/state/fedora-hyprland-installer/backups/`.
- 🐧 **Fedora-Native**: Built specifically for Fedora. Uses `dnf`, `systemctl`, and standard Fedora package repositories.
-**GPU Aware**: Detects NVIDIA, AMD Radeon, Intel, and hybrid setups and adds a conservative Hyprland-native cursor workaround for detected NVIDIA hardware.
- 🤝 **Desktop Coexistence**: Never removes GNOME, KDE, or Xfce. Hyprland is added as a session option at your GDM/SDDM login screen.
- 🛠️ **Scoped Repair**: Reports a missing config or portal package and inactive PipeWire/WirePlumber services; approved fixes can be applied with `repair.sh --apply`.
- 🧼 **Scoped Removal**: Removes the listed Hyprland-specific packages while preserving your base desktop and backups.
---
## 📦 What Gets Installed
When installing, the skill provisions a minimal, fast, and modern desktop stack:
| Component | Package / Tool | Purpose |
| :--- | :--- | :--- |
| **Compositor** | `hyprland` | Dynamic tiling Wayland compositor |
| **Terminal** | `kitty` | Fast, GPU-accelerated terminal |
| **Launcher** | `wofi` | Application launcher menu |
| **Status Bar** | `waybar` | Desktop panel & bar |
| **Portals** | `xdg-desktop-portal-hyprland`, `xdg-desktop-portal-gtk` | Screen sharing & file dialogs |
| **Audio** | `pipewire`, `wireplumber` | Low-latency audio & stream routing |
| **Notifications** | `dunst` | Desktop notification daemon |
| **Screenshots** | `grim`, `slurp`, `wl-clipboard` | Screen capture & clipboard support |
---
## 🚀 Quick Start & Usage
### Agent usage
Use the installation method documented by your agent or by the repository catalog, then invoke the skill in natural language. The skill does not assume a particular global directory or CLI executable.
- **Fresh Install**: `"Install Hyprland on my Fedora machine."`
- **Health Check**: `"Verify my Hyprland installation."`
- **Troubleshoot & Fix**: `"Fix my screen sharing on Hyprland"` or `"Hyprland won't start."`
- **Update Setup**: `"Update my Hyprland packages."`
- **Uninstall**: `"Uninstall Hyprland."`
---
## 🛠️ Direct Terminal Utilities
You can also run the built-in utilities in `scripts/` directly:
```bash
# Detect hardware, OS, and session information
bash ./scripts/detect-system.sh
# Detect GPU hardware (NVIDIA / AMD / Intel)
bash ./scripts/detect-gpu.sh
# Run preflight system verification
bash ./scripts/preflight.sh
# Verify health of your current Hyprland installation
bash ./scripts/verify.sh
# Run the isolated non-destructive test suite
bash ./tests/test-scripts.sh
```
---
## 📁 Repository Structure
```text
fedora-hyprland-installer/
├── SKILL.md # Antigravity Agent Skill definition & workflow rules
├── README.md # Project documentation
├── LICENSE # MIT License
├── scripts/ # Modular, safe shell scripts
│ ├── detect-system.sh
│ ├── detect-gpu.sh
│ ├── preflight.sh
│ ├── install.sh
│ ├── configure.sh
│ ├── verify.sh
│ ├── backup.sh
│ ├── repair.sh
│ └── uninstall.sh
├── references/ # Detailed knowledge base for Fedora, GPUs & Wayland
│ ├── fedora.md
│ ├── hyprland.md
│ ├── nvidia.md
│ ├── amd.md
│ ├── intel.md
│ ├── wayland.md
│ ├── portals.md
│ └── troubleshooting.md
└── tests/ # Safe, non-destructive test suite
├── test-detection.sh
└── test-scripts.sh
```
---
## 🤝 Contributing
Contributions, bug reports, and improvements are welcome! Feel free to open an issue or submit a pull request on GitHub.
---
## 📜 License
Distributed under the MIT License included in `LICENSE`.
@@ -0,0 +1,112 @@
---
name: fedora-hyprland-installer
description: Install, configure, verify, repair, update, and uninstall Hyprland on Fedora Linux with GPU-aware detection (NVIDIA/AMD/Intel).
category: devops
risk: critical
source: community
source_repo: maleksaadi0109/hyprfedora
source_type: community
date_added: "2026-07-26"
author: maleksaadi0109
tags: [fedora, hyprland, wayland, linux]
tools: [claude, cursor, gemini]
license: MIT
license_source: https://github.com/maleksaadi0109/hyprfedora/blob/3ec6d4fc5eecdb188613dd841dce9926ae5c8319/LICENSE
---
# Fedora Hyprland Installer Skill
This skill provides an automated, safety-first workflow for managing Hyprland on Fedora Linux.
## Resolve the Skill Directory
Before running a bundled script, resolve `SKILL_DIR` to the directory that
contains this `SKILL.md`. Do not assume the user's current working directory or
guess a global installation path. If the agent cannot resolve the installed
skill directory from its runtime context, stop and ask the user to provide it.
Invoke bundled shell files explicitly with `bash` and a quoted path, for
example `bash "$SKILL_DIR/scripts/detect-system.sh"`.
## When to Use
- Use when installing or updating a Fedora-packaged Hyprland desktop stack.
- Use when verifying a Hyprland session, portals, PipeWire, or WirePlumber on Fedora.
- Use when diagnosing the limited repair cases documented below or removing the Hyprland-specific packages installed by this workflow.
## Core Directives & Safety Rules
1. **Fedora-First**: Always use Fedora tools (`dnf`, `systemctl`, `loginctl`). Never use `apt`, `pacman`, or `yay`.
2. **Never Blindly Execute**: Inspect the system prior to any installation or modification.
3. **Preserve Existing Desktop**: Do not uninstall GNOME, KDE, or any existing desktop environment. Hyprland should be added as a session choice in the display manager (GDM/SDDM/LightDM).
4. **Mandatory Backup**: Always create a timestamped backup in `~/.local/state/fedora-hyprland-installer/backups/` before writing or altering configurations in `~/.config/hypr/`, `~/.config/waybar/`, etc.
5. **GPU Awareness**: Check whether the system uses NVIDIA, AMD, Intel, or Hybrid graphics before configuring environment variables or graphics drivers. Never use arbitrary `.run` installers for NVIDIA; rely on Fedora/RPM Fusion repositories.
6. **Privileged Operations**: Sudo commands must be clearly identified and communicated to the user. Do not hardcode passwords.
7. **Idempotency**: Running actions multiple times must be safe and avoid duplicate config lines.
8. **Explicit Consent**: Show the exact package or service changes first. Run scripts that mutate packages or services only after the user confirms; use `repair.sh` without `--apply` for diagnosis.
---
## Workflow Guide
### 1. Installation Workflow
When the user asks to **"Install Hyprland"** or **"Setup Hyprland on Fedora"**:
1. Execute `bash "$SKILL_DIR/scripts/detect-system.sh"` and `bash "$SKILL_DIR/scripts/detect-gpu.sh"`.
2. Execute `bash "$SKILL_DIR/scripts/preflight.sh"` to verify Fedora release, network, package manager, and sudo access.
3. Execute `bash "$SKILL_DIR/scripts/backup.sh"` to preserve any pre-existing configurations.
4. Show the package plan with `bash "$SKILL_DIR/scripts/install.sh" --dry-run`; after explicit approval, execute `bash "$SKILL_DIR/scripts/install.sh"` to install Hyprland, Wayland portal packages (`xdg-desktop-portal-hyprland`, `xdg-desktop-portal-gtk`), PipeWire/WirePlumber, terminal, launcher, status bar, and authentication agent.
5. Execute `bash "$SKILL_DIR/scripts/configure.sh"` to write a clean, functional initial Hyprland config (`~/.config/hypr/hyprland.conf`) tailored to detected terminal/launcher and GPU environment variables.
6. Execute `bash "$SKILL_DIR/scripts/verify.sh"` to ensure binaries, portal services, PipeWire, and login desktop entries (`/usr/share/wayland-sessions/hyprland.desktop`) exist and validate.
7. Present a summary report detailing installed packages, backup paths, and login instructions.
### 2. Repair Workflow
When the user asks to **"Fix Hyprland"**, **"Hyprland won't start"**, **"No audio"**, **"Screen sharing broken"**:
1. Run `bash "$SKILL_DIR/scripts/detect-system.sh"` and inspect system logs (`journalctl -xe`, `journalctl --user -u xdg-desktop-portal`).
2. Execute `bash "$SKILL_DIR/scripts/repair.sh"` to report a missing Hyprland config, missing portal package, and inactive PipeWire/WirePlumber services.
3. Review the proposed changes with the user, then execute `bash "$SKILL_DIR/scripts/repair.sh" --apply` only after approval. The script can create a missing config, install missing portal packages, and enable or restart the checked user services; investigate other faults manually.
4. Execute `bash "$SKILL_DIR/scripts/verify.sh"`.
### 3. Update Workflow
When the user asks to **"Update Hyprland"**:
1. Run `bash "$SKILL_DIR/scripts/backup.sh"`.
2. Show the package plan with `bash "$SKILL_DIR/scripts/install.sh" --dry-run --update` and obtain approval.
3. Update Hyprland and related Wayland packages via `bash "$SKILL_DIR/scripts/install.sh" --update`.
4. Validate configuration syntax and verify system integrity via `bash "$SKILL_DIR/scripts/verify.sh"`.
### 4. Uninstall Workflow
When the user asks to **"Uninstall Hyprland"**:
1. Explain to the user which packages will be removed.
2. Run `bash "$SKILL_DIR/scripts/backup.sh"`.
3. Show the removal list and obtain approval, then execute `bash "$SKILL_DIR/scripts/uninstall.sh" --yes` to remove the listed Hyprland-specific packages while preserving base desktop environments (GNOME/KDE) and user backup files.
---
## Reference Manuals
- [Fedora Details](references/fedora.md)
- [Hyprland Config Guide](references/hyprland.md)
- [NVIDIA Setup & Wayland](references/nvidia.md)
- [AMD Mesa Stack](references/amd.md)
- [Intel Mesa Stack](references/intel.md)
- [Wayland & Environment](references/wayland.md)
- [Portals & PipeWire](references/portals.md)
- [Troubleshooting Matrix](references/troubleshooting.md)
## Examples
Inspect the system and preview the package plan without changing it:
```bash
bash "$SKILL_DIR/scripts/detect-system.sh"
bash "$SKILL_DIR/scripts/detect-gpu.sh"
bash "$SKILL_DIR/scripts/install.sh" --dry-run
```
## Limitations
- Bundled shell files are intentionally non-executable under the repository
safety policy and must be invoked explicitly with `bash` as shown above.
- Fedora package availability varies by Fedora release and enabled repositories. This skill does not enable RPM Fusion or install GPU drivers.
- GPU detection identifies vendors, not whether a proposed configuration is correct for a particular driver version, hybrid-graphics routing, monitor, or laptop.
- The repair script covers only the checks it reports; it does not diagnose broken symlinks, kernel parameters, GPU driver mismatches, or every portal/audio failure.
- Generated configuration is a minimal starting point and is not merged into an existing `hyprland.conf`.
- Commands that install or remove packages, change services, or regenerate initramfs require review, explicit consent, and suitable privileges.
@@ -0,0 +1,10 @@
# AMD Radeon Support
## Driver Architecture
AMD GPUs use open-source kernel drivers (`amdgpu`) and the Mesa graphics stack included in Fedora by default.
## Verification
- Verify Mesa openGL driver: `glxinfo | grep "OpenGL vendor"`
- Verify RADV Vulkan driver: `vulkaninfo | grep driverName`
No proprietary driver installation is required for Hyprland on AMD GPUs.
@@ -0,0 +1,24 @@
# Fedora Linux System Conventions
## Package Management
Fedora utilizes `dnf` as its primary package manager.
```bash
sudo dnf install <package>
sudo dnf remove <package>
sudo dnf check-update
```
## Desktop Sessions & Wayland
Fedora Workstation uses Wayland by default with GDM (GNOME Display Manager) or SDDM (KDE).
Session files are stored in:
- `/usr/share/wayland-sessions/hyprland.desktop`
- `/usr/share/xsessions/` (for X11 fallback sessions)
## System Services
User-level services are managed via systemd:
```bash
systemctl --user status pipewire
systemctl --user status wireplumber
systemctl --user status xdg-desktop-portal
```
@@ -0,0 +1,22 @@
# Hyprland Compositor & Configuration
## Overview
Hyprland is a dynamic tiling Wayland compositor that does not sacrifice appearance.
## Key Config Locations
- Main configuration: `~/.config/hypr/hyprland.conf`
- Additional split configs: `~/.config/hypr/monitors.conf`, `~/.config/hypr/keybinds.conf`
## Common Keybindings (Default Base)
- `SUPER + RETURN`: Open terminal
- `SUPER + SPACE`: Application launcher (`wofi` / `rofi`)
- `SUPER + Q`: Close focused window
- `SUPER + M`: Exit Hyprland session
- `SUPER + R`: Reload Hyprland config
## Monitor Syntax
```text
monitor=name,resolution@hz,position,scale
# Example auto monitor setup:
monitor=,preferred,auto,1
```
@@ -0,0 +1,8 @@
# Intel Graphics Support
## Driver Architecture
Intel Integrated & Arc graphics utilize kernel drivers (`i915` or `xe`) and the Mesa Intel driver (`iris` / `ANV`).
## Verification
- Verify hardware acceleration: `vainfo`
- Check active driver: `lspci -nnk | grep -A 2 VGA`
@@ -0,0 +1,29 @@
# NVIDIA Support on Fedora Wayland / Hyprland
## Recommended Environment Variables
Some NVIDIA setups may require Wayland environment flags in `~/.config/hypr/hyprland.conf`; confirm them against the installed driver and Hyprland versions:
```text
env = LIBVA_DRIVER_NAME,nvidia
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = NVD_BACKEND,direct
```
For cursor rendering issues, use the Hyprland-native config option (Hyprland v0.36+):
```text
cursor {
no_hardware_cursors = true
}
```
> **Note**: The old `WLR_NO_HARDWARE_CURSORS=1` environment variable is **deprecated** since Hyprland v0.36+. Use the `cursor` config block above instead.
## Drivers on Fedora
If proprietary drivers are required, use packages maintained for Fedora, such as RPM Fusion's `akmod-nvidia`, after reviewing that repository's setup guidance. This skill does not enable RPM Fusion or install GPU drivers.
Never use raw `.run` installers from NVIDIA's website as they break Fedora kernel updates.
## Hybrid Graphics (Intel + NVIDIA / AMD + NVIDIA)
Laptops with dual GPUs may need additional configuration:
- Check active GPU: `supergfxctl` or `prime-run`
- Verify render offloading: `__NV_PRIME_RENDER_OFFLOAD=1 glxinfo | grep vendor`
@@ -0,0 +1,18 @@
# XDG Desktop Portals & PipeWire
## Portals Requirement
For screen sharing, file open dialogs, and screenshots under Hyprland:
- `xdg-desktop-portal`
- `xdg-desktop-portal-hyprland`
- `xdg-desktop-portal-gtk`
## Service Startup Order
```text
Hyprland starts
└─ exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
└─ systemctl --user restart xdg-desktop-portal
```
## Audio Architecture
PipeWire handles low-latency audio and video streams (screen sharing). WirePlumber manages session routing.
Status check: `wpctl status`
@@ -0,0 +1,53 @@
# Hyprland Troubleshooting Matrix
## Symptom 1: Black Screen on Boot (NVIDIA)
- **Cause**: Missing Wayland environment variables or modeset issue.
- **Investigation**: Check the installed NVIDIA driver documentation and whether `nvidia_drm.modeset=1` is active. If the symptom is specifically cursor-related, test `cursor { no_hardware_cursors = true }` in `hyprland.conf`.
## Symptom 2: Screen Sharing Not Working (OBS / Browser)
- **Cause**: Inactive portal or pipewire environment variable missing.
- **Fix**: Run:
```bash
systemctl --user restart xdg-desktop-portal-hyprland
systemctl --user restart xdg-desktop-portal
```
## Symptom 3: No Sound Output
- **Cause**: PipeWire or WirePlumber service failed.
- **Fix**: Run:
```bash
systemctl --user restart pipewire wireplumber
```
## Symptom 4: Cursor Missing or Invisible (NVIDIA)
- **Cause**: Hardware cursor rendering not supported by GPU driver.
- **Fix**: Add to `hyprland.conf`:
```text
cursor {
no_hardware_cursors = true
}
```
## Symptom 5: Apps Blurry or Wrong Scale (XWayland)
- **Cause**: XWayland apps not using native Wayland rendering.
- **Fix**: Set environment variables in `hyprland.conf`:
```text
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = MOZ_ENABLE_WAYLAND,1
```
## Symptom 6: Multi-Monitor Not Working
- **Cause**: Incorrect or missing monitor config.
- **Fix**: Check connected monitors with `hyprctl monitors` and configure in `hyprland.conf`:
```text
monitor=,preferred,auto,1
```
## Symptom 7: Flickering / Tearing (NVIDIA)
- **Cause**: Missing DRM kernel module setting.
- **Investigation**: Confirm the installed driver's recommended DRM settings before changing boot configuration. If its documentation requires these options, review and add them to `/etc/modprobe.d/nvidia.conf`:
```text
options nvidia_drm modeset=1 fbdev=1
```
Regenerating initramfs with `sudo dracut --force` is a privileged, boot-critical change. Back up the current configuration and obtain explicit approval before running it.
@@ -0,0 +1,9 @@
# Wayland Session Environment
## Key Environment Variables
- `XDG_CURRENT_DESKTOP=Hyprland`
- `XDG_SESSION_TYPE=wayland`
- `XDG_SESSION_DESKTOP=Hyprland`
- `MOZ_ENABLE_WAYLAND=1` (Firefox Wayland native mode)
- `QT_QPA_PLATFORM=wayland;xcb` (Qt app compatibility)
- `GDK_BACKEND=wayland,x11` (GTK app compatibility)
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Backup Script for Fedora Hyprland Installer
TIMESTAMP=$(date +"%Y%m%d-%H%M%S")
BACKUP_BASE="${HOME:?HOME is not set}/.local/state/fedora-hyprland-installer/backups"
BACKUP_DIR="${BACKUP_BASE}/${TIMESTAMP}"
echo "=== Hyprland Configuration Backup ==="
echo "Target backup directory: ${BACKUP_DIR}"
CONFIG_ITEMS=(
".config/hypr"
".config/waybar"
".config/wofi"
".config/rofi"
".config/kitty"
".config/alacritty"
".config/dunst"
".config/mako"
)
# Check if any config items exist before creating backup directory
HAS_ITEMS="false"
for item in "${CONFIG_ITEMS[@]}"; do
if [ -e "${HOME}/${item}" ]; then
HAS_ITEMS="true"
break
fi
done
if [ "$HAS_ITEMS" = "false" ]; then
echo "[i] No pre-existing Hyprland configuration files found to back up."
echo "BACKUP_PATH=none"
exit 0
fi
mkdir -p "${BACKUP_DIR}"
BACKED_UP_COUNT=0
for item in "${CONFIG_ITEMS[@]}"; do
SRC_PATH="${HOME}/${item}"
if [ -e "${SRC_PATH}" ]; then
DEST_PATH="${BACKUP_DIR}/${item}"
mkdir -p "$(dirname "${DEST_PATH}")"
if cp -a "${SRC_PATH}" "${DEST_PATH}"; then
echo "[+] Backed up: ~/${item} -> ${DEST_PATH}"
BACKED_UP_COUNT=$((BACKED_UP_COUNT + 1))
else
echo "[!] Warning: Failed to back up ~/${item}"
fi
fi
done
echo "[✓] Successfully created backup of $BACKED_UP_COUNT items at: ${BACKUP_DIR}"
cat <<EOF > "${BACKUP_DIR}/manifest.txt"
Backup Date: $(date)
Backed up items count: ${BACKED_UP_COUNT}
User: $(whoami)
EOF
echo "BACKUP_PATH=${BACKUP_DIR}"
@@ -0,0 +1,158 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Configuration Script for Fedora Hyprland Installer
echo "=== Configuring Hyprland Desktop Environment ==="
HYPR_DIR="${HOME}/.config/hypr"
HYPR_CONF="${HYPR_DIR}/hyprland.conf"
mkdir -p "${HYPR_DIR}"
# 1. Detect Terminal — find which terminal is actually available
TERMINAL_BIN=""
if command -v kitty &>/dev/null; then
TERMINAL_BIN="kitty"
elif command -v alacritty &>/dev/null; then
TERMINAL_BIN="alacritty"
elif command -v foot &>/dev/null; then
TERMINAL_BIN="foot"
elif command -v gnome-terminal &>/dev/null; then
TERMINAL_BIN="gnome-terminal"
fi
if [ -z "$TERMINAL_BIN" ]; then
echo "[!] Warning: No supported terminal emulator detected. Defaulting to kitty."
TERMINAL_BIN="kitty"
fi
# 2. Detect Launcher
LAUNCHER_BIN=""
if command -v wofi &>/dev/null; then
LAUNCHER_BIN="wofi --show drun"
elif command -v rofi &>/dev/null; then
LAUNCHER_BIN="rofi -show drun"
fi
if [ -z "$LAUNCHER_BIN" ]; then
echo "[!] Warning: No supported application launcher detected. Defaulting to wofi."
LAUNCHER_BIN="wofi --show drun"
fi
# 3. Detect GPU Environment Variables
GPU_CONFIG=""
if command -v lspci &>/dev/null && lspci -nnk 2>/dev/null | grep -iq "nvidia"; then
echo "[i] NVIDIA GPU detected. Adding conservative NVIDIA compatibility settings."
GPU_CONFIG=$(cat <<'ENVEOF'
# NVIDIA compatibility
env = LIBVA_DRIVER_NAME,nvidia
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = NVD_BACKEND,direct
cursor {
no_hardware_cursors = true
}
ENVEOF
)
fi
# 4. Generate hyprland.conf if missing
if [ ! -f "${HYPR_CONF}" ]; then
echo "[+] Creating clean ${HYPR_CONF}"
cat <<EOF > "${HYPR_CONF}"
# Fedora Hyprland Default Configuration
# Generated by hyprfedora — Antigravity Fedora Hyprland Installer Skill
# Monitor setup (auto detect resolution & position)
monitor=,preferred,auto,1
# Input config
input {
kb_layout = us
follow_mouse = 1
touchpad {
natural_scroll = true
}
}
general {
gaps_in = 5
gaps_out = 10
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
}
decoration {
rounding = 8
blur {
enabled = true
size = 3
passes = 1
}
}
animations {
enabled = true
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 5, myBezier
animation = windowsOut, 1, 5, default, popin 80%
animation = border, 1, 10, default
animation = fade, 1, 5, default
animation = workspaces, 1, 5, default
}
dwindle {
pseudotile = true
preserve_split = true
}
# Autostart essential services
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = /usr/libexec/polkit-gnome-authentication-agent-1
exec-once = waybar
exec-once = dunst
exec-once = swaybg -c '#1e1e2e'
${GPU_CONFIG}
# Keybindings
\$mainMod = SUPER
bind = \$mainMod, RETURN, exec, ${TERMINAL_BIN}
bind = \$mainMod, SPACE, exec, ${LAUNCHER_BIN}
bind = \$mainMod, Q, killactive,
bind = \$mainMod, M, exit,
bind = \$mainMod, E, exec, nautilus || thunar || pcmanfm
bind = \$mainMod, V, togglefloating,
bind = \$mainMod, R, exec, hyprctl reload
bind = \$mainMod, P, pseudo, # dwindle
bind = \$mainMod, J, togglesplit, # dwindle
# Move focus
bind = \$mainMod, left, movefocus, l
bind = \$mainMod, right, movefocus, r
bind = \$mainMod, up, movefocus, u
bind = \$mainMod, down, movefocus, d
# Switch workspaces
bind = \$mainMod, 1, workspace, 1
bind = \$mainMod, 2, workspace, 2
bind = \$mainMod, 3, workspace, 3
bind = \$mainMod, 4, workspace, 4
bind = \$mainMod, 5, workspace, 5
bind = \$mainMod, 6, workspace, 6
bind = \$mainMod, 7, workspace, 7
bind = \$mainMod, 8, workspace, 8
bind = \$mainMod, 9, workspace, 9
bind = \$mainMod, 0, workspace, 10
# Screenshots
bind = , Print, exec, grim -g "\$(slurp)" - | wl-copy
EOF
echo "[✓] Configuration generated successfully."
else
echo "[i] ${HYPR_CONF} already exists. Skipping default creation to preserve user edits."
fi
@@ -0,0 +1,71 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# GPU Detection Script for Fedora Hyprland Installer
PRIMARY_GPU="unknown"
NVIDIA_DETECTED="false"
AMD_DETECTED="false"
INTEL_DETECTED="false"
IS_HYBRID="false"
NVIDIA_DRIVER_ACTIVE="false"
LSPCI_OUTPUT=""
if command -v lspci &>/dev/null; then
LSPCI_OUTPUT=$(lspci -nnk 2>/dev/null | grep -A 2 -E "VGA|3D" || true)
fi
if echo "$LSPCI_OUTPUT" | grep -iq "nvidia" 2>/dev/null; then
NVIDIA_DETECTED="true"
fi
if echo "$LSPCI_OUTPUT" | grep -iq -E "amd|radeon|advanced micro devices" 2>/dev/null; then
AMD_DETECTED="true"
fi
if echo "$LSPCI_OUTPUT" | grep -iq "intel" 2>/dev/null; then
INTEL_DETECTED="true"
fi
# Count detected GPU vendors
GPU_COUNT=0
if [ "$NVIDIA_DETECTED" = "true" ]; then GPU_COUNT=$((GPU_COUNT + 1)); fi
if [ "$AMD_DETECTED" = "true" ]; then GPU_COUNT=$((GPU_COUNT + 1)); fi
if [ "$INTEL_DETECTED" = "true" ]; then GPU_COUNT=$((GPU_COUNT + 1)); fi
if [ "$GPU_COUNT" -gt 1 ]; then
IS_HYBRID="true"
fi
# Determine primary GPU label
if [ "$NVIDIA_DETECTED" = "true" ] && [ "$IS_HYBRID" = "false" ]; then
PRIMARY_GPU="nvidia"
elif [ "$AMD_DETECTED" = "true" ] && [ "$IS_HYBRID" = "false" ]; then
PRIMARY_GPU="amd"
elif [ "$INTEL_DETECTED" = "true" ] && [ "$IS_HYBRID" = "false" ]; then
PRIMARY_GPU="intel"
elif [ "$IS_HYBRID" = "true" ]; then
if [ "$NVIDIA_DETECTED" = "true" ]; then
PRIMARY_GPU="hybrid-nvidia"
else
PRIMARY_GPU="hybrid-other"
fi
fi
# Check if NVIDIA proprietary driver is loaded
if command -v nvidia-smi &>/dev/null && nvidia-smi &>/dev/null; then
NVIDIA_DRIVER_ACTIVE="true"
elif lsmod 2>/dev/null | grep -q "^nvidia" 2>/dev/null; then
NVIDIA_DRIVER_ACTIVE="true"
fi
cat <<EOF
{
"primary_gpu": "${PRIMARY_GPU}",
"nvidia_detected": ${NVIDIA_DETECTED},
"nvidia_driver_active": ${NVIDIA_DRIVER_ACTIVE},
"amd_detected": ${AMD_DETECTED},
"intel_detected": ${INTEL_DETECTED},
"is_hybrid": ${IS_HYBRID}
}
EOF
@@ -0,0 +1,95 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# System Detection Script for Fedora Hyprland Installer
FEDORA_VERSION="unknown"
if [ -f /etc/fedora-release ]; then
FEDORA_VERSION=$(cat /etc/fedora-release)
fi
KERNEL_RELEASE=$(uname -r)
ARCH=$(uname -m)
CURRENT_USER=$(whoami 2>/dev/null || echo "${USER:-unknown}")
CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:-unknown}"
SESSION_TYPE="${XDG_SESSION_TYPE:-unknown}"
# Detect Display Manager
DISPLAY_MANAGER="unknown"
for dm in gdm sddm lightdm gdm3; do
if systemctl is-active --quiet "$dm" 2>/dev/null; then
DISPLAY_MANAGER="$dm"
break
fi
done
# Detect Hyprland binary
HYPRLAND_INSTALLED="false"
HYPRLAND_VERSION="none"
if command -v Hyprland &>/dev/null || command -v hyprland &>/dev/null; then
HYPRLAND_INSTALLED="true"
HYPRLAND_VERSION=$(Hyprland --version 2>/dev/null | head -n1 || hyprland --version 2>/dev/null | head -n1 || echo "installed")
fi
# Detect PipeWire & WirePlumber
PIPEWIRE_STATUS="inactive"
if systemctl --user is-active --quiet pipewire 2>/dev/null; then
PIPEWIRE_STATUS="active"
fi
WIREPLUMBER_STATUS="inactive"
if systemctl --user is-active --quiet wireplumber 2>/dev/null; then
WIREPLUMBER_STATUS="active"
fi
# Detect XDG Desktop Portal
PORTAL_INSTALLED="false"
if rpm -q xdg-desktop-portal &>/dev/null; then
PORTAL_INSTALLED="true"
fi
PORTAL_HYPRLAND_INSTALLED="false"
if rpm -q xdg-desktop-portal-hyprland &>/dev/null; then
PORTAL_HYPRLAND_INSTALLED="true"
fi
# Detect CPU
CPU_MODEL="unknown"
if [ -f /proc/cpuinfo ]; then
CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo | cut -d':' -f2 | sed 's/^ //' || echo "unknown")
fi
# Detect RAM
RAM_TOTAL="unknown"
if [ -f /proc/meminfo ]; then
RAM_KB=$(grep -m1 "MemTotal" /proc/meminfo | awk '{print $2}')
RAM_TOTAL="$((RAM_KB / 1024)) MB"
fi
# Detect Flatpak
FLATPAK_AVAILABLE="false"
if command -v flatpak &>/dev/null; then
FLATPAK_AVAILABLE="true"
fi
# Output JSON-formatted report
cat <<EOF
{
"fedora_release": "${FEDORA_VERSION}",
"kernel": "${KERNEL_RELEASE}",
"arch": "${ARCH}",
"user": "${CURRENT_USER}",
"cpu": "${CPU_MODEL}",
"ram": "${RAM_TOTAL}",
"current_desktop": "${CURRENT_DESKTOP}",
"session_type": "${SESSION_TYPE}",
"display_manager": "${DISPLAY_MANAGER}",
"hyprland_installed": ${HYPRLAND_INSTALLED},
"hyprland_version": "${HYPRLAND_VERSION}",
"pipewire_status": "${PIPEWIRE_STATUS}",
"wireplumber_status": "${WIREPLUMBER_STATUS}",
"portal_installed": ${PORTAL_INSTALLED},
"portal_hyprland_installed": ${PORTAL_HYPRLAND_INSTALLED},
"flatpak_available": ${FLATPAK_AVAILABLE}
}
EOF
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Installation Script for Fedora Hyprland Installer
DRY_RUN="false"
UPDATE_MODE="false"
for arg in "$@"; do
case "$arg" in
--dry-run) DRY_RUN="true" ;;
--update) UPDATE_MODE="true" ;;
esac
done
echo "=== Installing Fedora Hyprland Packages ==="
# Base required Fedora packages for Hyprland desktop environment
CORE_PACKAGES=(
"hyprland"
"xdg-desktop-portal"
"xdg-desktop-portal-hyprland"
"xdg-desktop-portal-gtk"
"pipewire"
"wireplumber"
"kitty"
"wofi"
"waybar"
"dunst"
"grim"
"slurp"
"wl-clipboard"
"polkit-gnome"
"swaybg"
)
echo "Packages to ensure installed:"
for pkg in "${CORE_PACKAGES[@]}"; do
echo " - $pkg"
done
if [ "$DRY_RUN" = "true" ]; then
echo "[DRY-RUN] Would run: sudo dnf install -y ${CORE_PACKAGES[*]}"
exit 0
fi
if command -v dnf &>/dev/null; then
if [ "$UPDATE_MODE" = "true" ]; then
echo "[+] Updating Hyprland packages via dnf..."
# dnf install also handles upgrades for already-installed packages,
# ensuring missing packages are installed AND existing ones are updated.
sudo dnf install -y "${CORE_PACKAGES[@]}"
else
echo "[+] Installing Hyprland packages via dnf..."
sudo dnf install -y "${CORE_PACKAGES[@]}"
fi
else
echo "[!] Error: dnf package manager is missing."
exit 1
fi
echo "[✓] Core package installation completed."
@@ -0,0 +1,94 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Preflight Check Script for Fedora Hyprland Installer
echo "=== Fedora Hyprland Preflight Verification ==="
PASS_COUNT=0
WARN_COUNT=0
FAIL_COUNT=0
log_pass() { echo "[PASS] $1"; PASS_COUNT=$((PASS_COUNT + 1)); }
log_warn() { echo "[WARN] $1"; WARN_COUNT=$((WARN_COUNT + 1)); }
log_fail() { echo "[FAIL] $1"; FAIL_COUNT=$((FAIL_COUNT + 1)); }
# Check 1: Fedora Linux OS
if [ -f /etc/fedora-release ]; then
FEDORA_VER=$(cat /etc/fedora-release)
log_pass "Fedora Linux detected ($FEDORA_VER)"
else
log_fail "Not a Fedora Linux distribution! This skill is Fedora-first."
fi
# Check 2: System Architecture
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ]; then
log_pass "Supported architecture: $ARCH"
else
log_warn "Unusual architecture: $ARCH"
fi
# Check 3: Package Manager (dnf)
if command -v dnf &>/dev/null; then
log_pass "Package manager 'dnf' is available"
else
log_fail "Package manager 'dnf' not found"
fi
# Check 4: Network Access
if ping -c 1 -W 3 fedoraproject.org &>/dev/null || ping -c 1 -W 3 8.8.8.8 &>/dev/null; then
log_pass "Network connectivity active"
else
log_warn "Network connection could not be verified"
fi
# Check 5: Disk Space (require at least 2GB free on /)
FREE_KB=$(df -k / | awk 'NR==2 {print $4}')
FREE_GB=$((FREE_KB / 1024 / 1024))
if [ "$FREE_KB" -gt 2097152 ]; then
log_pass "Sufficient disk space available (${FREE_GB} GB free)"
else
log_warn "Low disk space (${FREE_GB} GB free, <2GB recommended)"
fi
# Check 6: Sudo availability
if command -v sudo &>/dev/null; then
log_pass "Sudo command utility is installed"
else
log_warn "Sudo command utility not found"
fi
# Check 7: Existing Hyprland installation
if command -v Hyprland &>/dev/null || command -v hyprland &>/dev/null; then
log_warn "Hyprland is already installed on this system"
else
log_pass "No existing Hyprland installation detected"
fi
# Check 8: GPU detection quick check
if command -v lspci &>/dev/null; then
GPU_LINE=$(lspci 2>/dev/null | grep -iE "VGA|3D" | head -n1 || echo "")
if [ -n "$GPU_LINE" ]; then
log_pass "GPU detected: $GPU_LINE"
else
log_warn "No GPU detected via lspci"
fi
else
log_warn "lspci not available — cannot detect GPU"
fi
# Check 9: PipeWire status
if systemctl --user is-active --quiet pipewire 2>/dev/null; then
log_pass "PipeWire audio server is running"
else
log_warn "PipeWire is not currently running"
fi
echo "----------------------------------------------"
echo "Preflight Summary: $PASS_COUNT passed, $WARN_COUNT warnings, $FAIL_COUNT failures"
if [ "$FAIL_COUNT" -gt 0 ]; then
exit 1
fi
exit 0
@@ -0,0 +1,92 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Repair Script for Fedora Hyprland Installer
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APPLY="false"
if [ "${1:-}" = "--apply" ]; then
APPLY="true"
elif [ "$#" -gt 0 ]; then
echo "Usage: $0 [--apply]" >&2
exit 2
fi
echo "=== Hyprland Repair Subsystem ==="
REPAIRS_MADE=0
# Subsystem 1: Missing or corrupted hyprland.conf
HYPR_CONF="${HOME}/.config/hypr/hyprland.conf"
if [ ! -f "${HYPR_CONF}" ]; then
echo "[!] Missing hyprland.conf detected."
if [ "$APPLY" = "true" ]; then
bash "${SCRIPT_DIR}/configure.sh"
REPAIRS_MADE=$((REPAIRS_MADE + 1))
else
echo "[PLAN] Would run configure.sh to create a minimal configuration."
fi
fi
# Subsystem 2: XDG Desktop Portal repair
if ! rpm -q xdg-desktop-portal-hyprland &>/dev/null; then
echo "[!] Missing xdg-desktop-portal-hyprland."
if [ "$APPLY" = "true" ] && command -v dnf &>/dev/null; then
echo "[+] Installing portal packages..."
if sudo dnf install -y xdg-desktop-portal-hyprland xdg-desktop-portal-gtk; then
REPAIRS_MADE=$((REPAIRS_MADE + 1))
else
echo "[!] Warning: Failed to install portal packages."
fi
elif [ "$APPLY" = "false" ]; then
echo "[PLAN] Would install xdg-desktop-portal-hyprland and xdg-desktop-portal-gtk."
fi
fi
# Subsystem 3: PipeWire / WirePlumber user services
if command -v systemctl &>/dev/null; then
if ! systemctl --user is-active --quiet pipewire 2>/dev/null; then
if [ "$APPLY" = "true" ]; then
echo "[+] Enabling user service: pipewire"
if systemctl --user enable --now pipewire; then
REPAIRS_MADE=$((REPAIRS_MADE + 1))
else
echo "[!] Warning: Failed to enable pipewire."
fi
else
echo "[PLAN] Would enable and start the pipewire user service."
fi
fi
if ! systemctl --user is-active --quiet wireplumber 2>/dev/null; then
if [ "$APPLY" = "true" ]; then
echo "[+] Enabling user service: wireplumber"
if systemctl --user enable --now wireplumber; then
REPAIRS_MADE=$((REPAIRS_MADE + 1))
else
echo "[!] Warning: Failed to enable wireplumber."
fi
else
echo "[PLAN] Would enable and start the wireplumber user service."
fi
fi
fi
# Subsystem 4: Restart user portals
if [ "$APPLY" = "true" ] && command -v systemctl &>/dev/null; then
echo "[+] Resetting XDG portal user services..."
systemctl --user restart xdg-desktop-portal-hyprland 2>/dev/null || true
systemctl --user restart xdg-desktop-portal 2>/dev/null || true
fi
echo "---------------------------------"
if [ "$APPLY" = "false" ]; then
echo "[i] Diagnostic complete. Re-run with --apply after reviewing the plan."
elif [ "$REPAIRS_MADE" -gt 0 ]; then
echo "[✓] Repair complete. $REPAIRS_MADE issues addressed."
else
echo "[i] Repair check finished. No automated issues identified."
fi
if [ "$APPLY" = "true" ]; then
bash "${SCRIPT_DIR}/verify.sh"
fi
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Uninstall Script for Fedora Hyprland Installer
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ "${1:-}" != "--yes" ] || [ "$#" -ne 1 ]; then
echo "Usage: $0 --yes" >&2
echo "Review the package list in this script before confirming removal." >&2
exit 2
fi
echo "=== Uninstall Hyprland Setup ==="
PACKAGES_TO_REMOVE=(
"hyprland"
"xdg-desktop-portal-hyprland"
)
echo "The following Hyprland-specific packages will be removed:"
for pkg in "${PACKAGES_TO_REMOVE[@]}"; do
echo " - $pkg"
done
echo ""
echo "Note: Base desktop environments (GNOME, KDE Plasma, Xfce) and user backup files will NOT be touched."
# Run backup prior to uninstallation
if [ -f "${SCRIPT_DIR}/backup.sh" ]; then
echo "[+] Creating final backup before uninstallation..."
bash "${SCRIPT_DIR}/backup.sh" || true
fi
if command -v dnf &>/dev/null; then
echo "[+] Executing dnf removal..."
# Filter to only remove packages that are actually installed
INSTALLED_TO_REMOVE=()
for pkg in "${PACKAGES_TO_REMOVE[@]}"; do
if rpm -q "$pkg" &>/dev/null; then
INSTALLED_TO_REMOVE+=("$pkg")
else
echo "[i] Package '$pkg' is not installed, skipping."
fi
done
if [ "${#INSTALLED_TO_REMOVE[@]}" -gt 0 ]; then
sudo dnf remove -y "${INSTALLED_TO_REMOVE[@]}"
echo "[✓] Hyprland packages removed successfully."
else
echo "[i] No Hyprland packages found to remove."
fi
else
echo "[!] dnf package manager not found."
exit 1
fi
echo "Uninstallation finished cleanly."
@@ -0,0 +1,92 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Verification Script for Fedora Hyprland Installer
echo "=== Verification Report ==="
STATUS="SUCCESS"
CHECK_PASS=0
CHECK_WARN=0
CHECK_FAIL=0
log_check() {
local level="$1"
local msg="$2"
if [ "$level" = "PASS" ]; then
echo "$msg"
CHECK_PASS=$((CHECK_PASS + 1))
elif [ "$level" = "WARN" ]; then
echo " ! $msg"
CHECK_WARN=$((CHECK_WARN + 1))
else
echo "$msg"
CHECK_FAIL=$((CHECK_FAIL + 1))
fi
}
echo "Components Check:"
# 1. Hyprland executable
if command -v Hyprland &>/dev/null || command -v hyprland &>/dev/null; then
ver=$(Hyprland --version 2>/dev/null | head -n1 || hyprland --version 2>/dev/null | head -n1 || echo "installed")
log_check "PASS" "Hyprland binary found ($ver)"
else
log_check "FAIL" "Hyprland binary not found in PATH"
fi
# 2. Hyprland configuration file
HYPR_CONF="${HOME}/.config/hypr/hyprland.conf"
if [ -f "${HYPR_CONF}" ]; then
log_check "PASS" "Hyprland configuration exists at ${HYPR_CONF}"
else
log_check "FAIL" "Hyprland configuration missing at ${HYPR_CONF}"
fi
# 3. Session Desktop Entry
if [ -f /usr/share/wayland-sessions/hyprland.desktop ]; then
log_check "PASS" "Wayland session entry exists (/usr/share/wayland-sessions/hyprland.desktop)"
else
log_check "WARN" "Wayland session entry missing in /usr/share/wayland-sessions/"
fi
# 4. PipeWire & WirePlumber
if systemctl --user is-active --quiet pipewire 2>/dev/null || pgrep -x pipewire &>/dev/null; then
log_check "PASS" "PipeWire audio server is running"
else
log_check "WARN" "PipeWire audio server is not currently active"
fi
if systemctl --user is-active --quiet wireplumber 2>/dev/null || pgrep -x wireplumber &>/dev/null; then
log_check "PASS" "WirePlumber session manager is running"
else
log_check "WARN" "WirePlumber is not currently active"
fi
# 5. XDG Desktop Portal
if rpm -q xdg-desktop-portal-hyprland &>/dev/null; then
log_check "PASS" "XDG Desktop Portal Hyprland backend installed"
else
log_check "WARN" "XDG Desktop Portal backend for Hyprland not detected"
fi
# Determine overall status
if [ "$CHECK_FAIL" -gt 0 ]; then
STATUS="FAILED"
elif [ "$CHECK_WARN" -gt 0 ]; then
STATUS="PARTIAL"
fi
echo "----------------------------------------"
echo "Installation Status: ${STATUS}"
echo "Checks: ${CHECK_PASS} passed, ${CHECK_WARN} warnings, ${CHECK_FAIL} failed"
if [ "$STATUS" = "SUCCESS" ]; then
echo "Next steps: Log out and select 'Hyprland' from your login screen desktop session menu."
exit 0
elif [ "$STATUS" = "PARTIAL" ]; then
echo "Notice: Installation completed with minor warnings. Review warnings above."
exit 0
else
exit 1
fi
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Test Detection Logic (Non-destructive)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../scripts" && pwd)"
echo "=== Testing System & GPU Detection Scripts ==="
echo "Testing detect-system.sh..."
SYS_OUT=$(bash "${SCRIPT_DIR}/detect-system.sh")
echo "$SYS_OUT"
python3 -c 'import json,sys; data=json.load(sys.stdin); required={"fedora_release","kernel","arch","hyprland_installed"}; assert required <= data.keys(); assert isinstance(data["hyprland_installed"], bool)' <<<"$SYS_OUT"
echo "[PASS] detect-system.sh output is valid JSON with required fields."
echo "Testing detect-gpu.sh..."
GPU_OUT=$(bash "${SCRIPT_DIR}/detect-gpu.sh")
echo "$GPU_OUT"
python3 -c 'import json,sys; data=json.load(sys.stdin); required={"primary_gpu","nvidia_detected","nvidia_driver_active","amd_detected","intel_detected","is_hybrid"}; assert required <= data.keys(); assert all(isinstance(data[key], bool) for key in required - {"primary_gpu"})' <<<"$GPU_OUT"
echo "[PASS] detect-gpu.sh output is valid JSON with required fields."
echo "[✓] All detection script unit tests passed!"
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -Eeuo pipefail
# Non-destructive test runner for installer scripts
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../scripts" && pwd)"
TEST_HOME=$(mktemp -d "${TMPDIR:-/tmp}/fedora-hyprland-test.XXXXXX")
trap 'rm -rf "$TEST_HOME"' EXIT
export HOME="$TEST_HOME"
echo "=== Running Non-Destructive Installer Test Suite ==="
# 1. Shell syntax test
echo "Checking shell syntax..."
for script in "${SCRIPT_DIR}"/*.sh; do
bash -n "$script"
done
# 2. Dry run install test
echo "Running install dry-run test..."
INSTALL_OUT=$(bash "${SCRIPT_DIR}/install.sh" --dry-run)
echo "$INSTALL_OUT"
grep -Fq "[DRY-RUN] Would run: sudo dnf install" <<<"$INSTALL_OUT"
# 3. Backup test
echo "Running isolated backup test..."
mkdir -p "$HOME/.config/hypr"
printf '%s\n' 'monitor=,preferred,auto,1' > "$HOME/.config/hypr/hyprland.conf"
BACKUP_OUT=$(bash "${SCRIPT_DIR}/backup.sh")
echo "$BACKUP_OUT"
BACKUP_PATH=$(sed -n 's/^BACKUP_PATH=//p' <<<"$BACKUP_OUT")
test -n "$BACKUP_PATH"
case "$BACKUP_PATH" in
"$HOME"/.local/state/fedora-hyprland-installer/backups/*) ;;
*) echo "[FAIL] backup escaped isolated HOME: $BACKUP_PATH" >&2; exit 1 ;;
esac
test -f "$BACKUP_PATH/.config/hypr/hyprland.conf"
cmp "$HOME/.config/hypr/hyprland.conf" "$BACKUP_PATH/.config/hypr/hyprland.conf"
echo "[PASS] backup.sh copied configuration inside isolated HOME."
# 4. Existing configuration must be preserved
cp "$HOME/.config/hypr/hyprland.conf" "$TEST_HOME/hyprland.conf.before"
bash "${SCRIPT_DIR}/configure.sh"
cmp "$TEST_HOME/hyprland.conf.before" "$HOME/.config/hypr/hyprland.conf"
echo "[PASS] configure.sh preserved an existing configuration."
echo "[✓] All non-destructive installer test suite cases completed successfully."