# Grab

Grab is a modern desktop application built with Tauri, React, and Rust that simplifies the process of installing and managing NVIDIA GPU drivers on **Fedora** and **RHEL-family** (Rocky, AlmaLinux, CentOS) distributions.

It provides a step-by-step, interactive checklist that ensures all prerequisites are met before attempting to install the driver, eliminating the common headaches associated with Linux NVIDIA setups.

## ✨ Features

- **Automatic Distribution Detection:** Seamlessly adjusts its behavior for Fedora or RHEL-family systems.
- **Dependency Management:** Automatically sets up EPEL (on RHEL) and the RPM Fusion (Free & Non-Free) repositories.
- **Kernel Verification:** Checks that your running kernel matches the latest installed kernel headers (`kernel-devel`) to ensure successful driver module compilation.
- **Secure Boot Detection:** Informs you if Secure Boot is enabled and helps install the necessary module signing tools (`mokutil`, `akmods`, `kmodtool`).
- **One-Click Installation:** Installs the `akmod-nvidia` and CUDA driver packages automatically.
- **Driver Status & Updates:** Detects the currently installed driver version, the actively loaded kernel module, and notifies you when an update is available in the repositories.

## 📦 Installation (from pre-built RPM)

*If a `.rpm` release is provided on the repository releases page:*

1. Download the `grab-*.x86_64.rpm` file.
2. Install it using `dnf`:
   ```bash
   sudo dnf install ./grab-*.x86_64.rpm
   ```
3. Launch "Grab" from your application menu!

---

## 🛠️ Building from Source

To compile and run Grab yourself, you'll need to set up the Tauri development environment.

### 1. System Dependencies

Before building, you need to install the required system libraries for Tauri and building RPMs.

**Fedora:**
```bash
sudo dnf install webkit2gtk4.1-devel libsoup3-devel gtk3-devel librsvg2-devel \
    glib2-devel pango-devel cairo-devel gdk-pixbuf2-devel \
    rpm-build
```

**RHEL / Rocky Linux / AlmaLinux:**
```bash
sudo dnf install epel-release
sudo dnf config-manager --set-enabled crb
sudo dnf install webkit2gtk4.1-devel libsoup3-devel gtk3-devel librsvg2-devel \
    glib2-devel pango-devel cairo-devel gdk-pixbuf2-devel \
    rpm-build
```

### 2. Install Development Tools

You need **Rust** and **Node.js** (or Bun/npm).

1. Install [Rust](https://rustup.rs/):
   ```bash
   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
   ```
2. Install [Node.js](https://nodejs.org/) (v18 or higher) or [Bun](https://bun.sh/).

### 3. Clone and Build

1. Clone the repository:
   ```bash
   git clone https://codeberg.org/oadardery/grab-fedora-gpu-manager.git
   cd grab-fedora-gpu-manager
   ```

2. Install frontend dependencies:
   ```bash
   npm install
   # or if using bun:
   bun install
   ```

3. Run the application in development mode:
   ```bash
   npm run tauri dev
   # or
   bun tauri dev
   ```

4. Build a production RPM package:
   ```bash
   npm run tauri build
   # or
   bun tauri build
   ```
   *The compiled RPM will be located in `src-tauri/target/release/bundle/rpm/`.*

## 🔒 Security & Privileges

Grab runs as a standard user application. However, interacting with system packages and repositories requires root privileges. 

When you click an "Install" or "Update" button within the app, Grab uses `pkexec` (PolicyKit) to request temporary root privileges. You will see a standard system password prompt asking for permission to run the required `dnf` commands. The included Polkit policy specifically restricts this to `dnf` package management.

## 📝 License

This project is licensed under the MIT License.
