Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
echo "Triggered builds for:" >> $GITHUB_STEP_SUMMARY
echo "- Windows" >> $GITHUB_STEP_SUMMARY
echo "- Linux (x64 + ARM64)" >> $GITHUB_STEP_SUMMARY
echo "- Linux 32-bit (i686 + ARMv7)" >> $GITHUB_STEP_SUMMARY
echo "- macOS (Universal)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Check the [Actions tab](/${{ github.repository }}/actions) for build progress." >> $GITHUB_STEP_SUMMARY
5 changes: 0 additions & 5 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
- main
pull_request: {}

permissions:
attestations: write
contents: read
id-token: write

env:
CARGO_TERM_COLOR: always

Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
- main
pull_request: {}

permissions:
attestations: write
contents: read
id-token: write

env:
CARGO_TERM_COLOR: always

Expand Down Expand Up @@ -39,16 +34,16 @@ jobs:
mkdir -p AppIcon.iconset

# Convert PNG to various sizes required for macOS icon
sips -z 16 16 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/icon_16x16.png"
sips -z 32 32 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/[email protected]"
sips -z 32 32 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/icon_32x32.png"
sips -z 64 64 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/[email protected]"
sips -z 128 128 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/icon_128x128.png"
sips -z 256 256 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/[email protected]"
sips -z 256 256 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/icon_256x256.png"
sips -z 512 512 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/[email protected]"
sips -z 512 512 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/icon_512x512.png"
sips -z 1024 1024 "assets/Icons/icon-macOS-Dark-1024x1024@1x.png" --out "AppIcon.iconset/[email protected]"
sips -z 16 16 "assets/Icons/icon.png" --out "AppIcon.iconset/icon_16x16.png"
sips -z 32 32 "assets/Icons/icon.png" --out "AppIcon.iconset/[email protected]"
sips -z 32 32 "assets/Icons/icon.png" --out "AppIcon.iconset/icon_32x32.png"
sips -z 64 64 "assets/Icons/icon.png" --out "AppIcon.iconset/[email protected]"
sips -z 128 128 "assets/Icons/icon.png" --out "AppIcon.iconset/icon_128x128.png"
sips -z 256 256 "assets/Icons/icon.png" --out "AppIcon.iconset/[email protected]"
sips -z 256 256 "assets/Icons/icon.png" --out "AppIcon.iconset/icon_256x256.png"
sips -z 512 512 "assets/Icons/icon.png" --out "AppIcon.iconset/[email protected]"
sips -z 512 512 "assets/Icons/icon.png" --out "AppIcon.iconset/icon_512x512.png"
sips -z 1024 1024 "assets/Icons/icon.png" --out "AppIcon.iconset/[email protected]"

# Convert iconset to icns
iconutil -c icns AppIcon.iconset -o AppIcon.icns
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
- main
pull_request: {}

permissions:
attestations: write
contents: read
id-token: write

env:
CARGO_TERM_COLOR: always

Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "nextui-installer"
version = "1.0.0"
edition = "2021"
description = "NextUI SD Card Installer"
authors = ["SpruceOS Team", "NextUI Team"]
description = "NextUI SD Card Setup"
authors = ["spruceOS Team", "NextUI Team"]
license = "GPL-3.0-or-later"

[features]
Expand Down Expand Up @@ -44,3 +44,4 @@ embed-resource = "2"
opt-level = "z"
lto = true
strip = "debuginfo"

224 changes: 173 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
---

## To-Do

- ~~x64 Linux hangs for a sec before ejecting safely, possible bug, it does eject though.~~ idk if this is really fixed it only happens sometimes for me?

---


# NextUI Installer

## Overview
Expand All @@ -18,7 +9,7 @@ It can be easily edited and adapted to work with **any custom firmware (CFW)** t
GitHub Actions are set up to automatically **build and create releases per branch**.
If you’d like to use this program for your own project, let us know—we can create a branch for you or add you directly to the repository.

> **Please do not remove the Spruce team from the authors section.**
> **Please do not remove the Spruce or NextUI teams from the authors section.**
> Instead, add your name alongside the existing credits.


Expand Down Expand Up @@ -65,46 +56,51 @@ Edit these constants:
|-------|---------|---------|
| `APP_NAME` | Display name of your OS (window title, UI) | `"NextUI"` |
| `VOLUME_LABEL` | FAT32 SD card label (max 11 chars, uppercase) | `"NEXTUI"` |
| `REPO_OPTIONS` | Array of repositories to fetch | `[("NextUI stable", "LoveRetro/NextUI")]` |
| `DEFAULT_REPO_INDEX` | Index of the default repo selection | `0` |
| `REPO_OPTIONS` | Array of repositories to fetch releases from | `[("Stable", "LoveRetro/NextUI"), ("Nightlies", "LoveRetro/NextUI-nightly")]` |
| `DEFAULT_REPO_INDEX` | Index of the default repo selection (0 = first) | `0` |
| `ASSET_EXTENSION` | File extension to download from releases | `".7z"` or `".zip"` |
| `WINDOW_SIZE` | Default window size (width, height) | `(679.5, 420.0)` |
| `WINDOW_MIN_SIZE` | Minimum window size (width, height) | `(679.5, 420.0)` |

> **Notes:**
> **Notes:**
> - `WINDOW_TITLE`, `USER_AGENT`, and `TEMP_PREFIX` are auto-generated from `APP_NAME`. You usually **do not need to change these**.
> - The `setup_theme()` function in `config.rs` uses the Gruvbox Dark preset. This is a fallback; the actual theme is customized in `app.rs`.

---

### 2. Theme Colors
### 2. `src/app.rs` — Theme Colors & UI Customization

Customize the installer’s look and feel via RGB colors in `config.rs`:
The installer's visual theme is defined in the `get_theme_config()` method (around line 136 in `app.rs`). This method returns a `ThemeConfig` with color overrides in **RGBA format** `[R, G, B, A]` (values 0-255).

| Constant | Usage |
|----------|-------|
| `COLOR_BG_DARK` | Main window background |
| `COLOR_BG_MEDIUM` | Panels, input fields |
| `COLOR_BG_LIGHT` | Buttons and interactive elements |
| `COLOR_ACCENT` | Primary accents (headings, highlights, progress bars) |
| `COLOR_ACCENT_DIM` | Hover states, selections |
| `COLOR_TEXT` | Primary text |
| `COLOR_TEXT_DIM` | Secondary labels/text |
| `COLOR_SUCCESS` | Success messages |
| `COLOR_ERROR` | Error messages |
| `COLOR_WARNING` | Warning/destructive alerts |
**Key color fields to customize:**

The theme is applied automatically via `setup_theme(ctx)` in the internal theme setup.
| Field | Purpose | NextUI Default (RGBA) |
|-------|---------|------------------------|
| `override_text_color` | Primary text color | `[251, 241, 199, 255]` (cream) |
| `override_weak_text_color` | Secondary/dimmed text | `[124, 111, 100, 255]` (gray) |
| `override_hyperlink_color` | Clickable links | `[131, 165, 152, 255]` (teal) |
| `override_faint_bg_color` | Input fields, panels | `[48, 48, 48, 255]` (dark gray) |
| `override_extreme_bg_color` | Window background | `[29, 32, 33, 255]` (near black) |
| `override_warn_fg_color` | Warning messages | `[214, 93, 14, 255]` (orange) |
| `override_error_fg_color` | Error messages | `[204, 36, 29, 255]` (red) |
| `override_selection_bg` | Text selection, highlights | `[215, 180, 95, 255]` (gold) |
| `override_widget_inactive_bg_fill` | Inactive buttons | `[215, 180, 95, 255]` (gold) |
| `override_widget_inactive_fg_stroke_color` | Inactive button border | `[104, 157, 106, 255]` (green) |
| `override_widget_hovered_bg_stroke_color` | Hovered button border | `[215, 180, 95, 255]` (gold) |
| `override_widget_active_bg_stroke_color` | Active button border | `[215, 180, 95, 255]` (gold) |

---
> **Note:** Set a field to `None` to use the default egui value. The theme config has many more fields for fine-grained control — see the full list in the `ThemeConfig` struct.

### 3. Window Settings
**Hardcoded UI colors** (also in `app.rs`):
- Line ~1036, 1097: Success message color `Color32::from_rgb(104, 157, 106)` (green)
- Line ~1397: Install button fill `Color32::from_rgb(104, 157, 106)` (green)
- Line ~1417: Cancel button fill `Color32::from_rgb(251, 73, 52)` (red)

| Constant | Purpose |
|----------|---------|
| `WINDOW_SIZE` | Default window size `(width, height)` |
| `WINDOW_MIN_SIZE` | Minimum window size `(width, height)` |
To change these, search for `Color32::from_rgb` in `app.rs` and update the RGB values.

---

### 4. Icons
### 3. Icons

Customize the application icon:

Expand All @@ -113,12 +109,42 @@ Customize the application icon:
| PNG | `assets/Icons/icon.png` | Window, title bar (all platforms) |
| ICO | `assets/Icons/icon.ico` | Windows Explorer, taskbar |

> Notes:
> - PNG: Recommended 64x64 or 128x128 with transparency
> - ICO: Multi-resolution preferred (16x16, 32x32, 48x48, 256x256)
> - Update `APP_ICON_PNG` path if needed
> Notes:
> - PNG: Recommended 64x64 or 128x128 with transparency
> - ICO: Multi-resolution preferred (16x16, 32x32, 48x48, 256x256)
> - The icon is loaded via `APP_ICON_PNG` in `config.rs` (requires the `icon` feature enabled)

---

### 4. Custom Font

The installer uses a custom font for all UI text. To use your own font:

> **Important:** Once your branch is pushed, GitHub Actions will automatically build your branch — no manual compilation is required.
**Replace the font file:**
```bash
# Replace the existing font with your own TTF/OTF file
cp /path/to/your/font.ttf assets/Fonts/nunwen.ttf
```

**Update the font configuration in `src/config.rs`:**

| Constant | Purpose | Default |
|----------|---------|---------|
| `CUSTOM_FONT` | Path to the embedded font file | `"../assets/Fonts/nunwen.ttf"` |
| `CUSTOM_FONT_NAME` | Display name for the font (optional, cosmetic) | `"Nunwen"` |

**Example:**
```rust
// If you want to use a different filename:
pub const CUSTOM_FONT: &[u8] = include_bytes!("../assets/Fonts/YourFont.ttf");
pub const CUSTOM_FONT_NAME: &str = "YourFont";
```

> **Notes:**
> - Supports TTF and OTF font formats
> - The font is embedded in the binary, so no external font files are needed at runtime
> - The custom font applies to all UI text (buttons, labels, dropdowns, etc.)
> - To also use the font for monospace text (logs), uncomment the Monospace section in `load_custom_fonts()`

---

Expand All @@ -134,23 +160,119 @@ To fully rebrand the installer, also update:

## Advanced Notes

- **Internal Identifiers** (`WINDOW_TITLE`, `USER_AGENT`, `TEMP_PREFIX`) are auto-generated; modifying them is optional.
- `setup_theme(ctx)` configures `egui` visuals for all widgets and windows. Editing it is **only recommended for advanced developers**.
- `REPO_OPTIONS` can include multiple repos for stable, nightlies, or forks.
- **Internal Identifiers** (`WINDOW_TITLE`, `USER_AGENT`, `TEMP_PREFIX`) are auto-generated from `APP_NAME`; modifying them is optional.
- `setup_theme(ctx)` in `config.rs` is a fallback that applies the Gruvbox Dark preset. The actual theme used by the installer is defined in `app.rs` via `get_theme_config()`.
- `REPO_OPTIONS` can include multiple repos (e.g., stable, nightlies, forks). The user can select between them via a dropdown in the UI.
- The installer uses `egui` and `egui_thematic` for the UI. The theme can be edited live using the built-in theme editor (press Ctrl+T in the app).
- All color values in `ThemeConfig` use RGBA format `[R, G, B, A]` where each value is 0-255.

---

## Recommended Workflow for Developers

1. Fork or clone the repository.
2. Create a **new branch** for your customizations.
3. Update `APP_NAME`, `VOLUME_LABEL`, and `REPO_OPTIONS`.
4. Adjust theme colors if desired.
5. Replace icons and update `Info.plist` / `Cargo.toml`.
6. Push your branch to GitHub.
### Quick Start (Minimal Customization)

1. Fork or clone the repository.
2. Create a **new branch** for your customizations (or use an existing branch).
3. Update `APP_NAME`, `VOLUME_LABEL`, and `REPO_OPTIONS` in `src/config.rs`
4. Replace `assets/Icons/icon.png` and `icon.ico` with your branding
5. **(Optional)** Replace `assets/Fonts/nunwen.ttf` with your custom font
6. Update `Cargo.toml` and `assets/Mac/Info.plist` with your project info
7. Push your branch to GitHub.

> GitHub Actions will automatically build Windows, Linux (x64 + ARM64), and macOS (ARM64 + x64) binaries — **no local build setup required**.

---

### Full Theme Customization (Using the Live Theme Editor)

The installer includes a **built-in theme editor** that lets you customize colors visually and export the theme config directly. This is much faster than manually editing RGBA values in code.

#### Step 1: Build and Run the Installer

First, build the installer locally so you can use the theme editor:

```bash
# Install Rust if you haven't already
# https://rustup.rs/

# Clone and build
git clone https://github.com/LoveRetro/NextUI-Installer.git
cd NextUI-Installer
cargo run
```

#### Step 2: Open the Theme Editor

With the installer running, press **Ctrl+T** to open the theme editor panel. This will open on the right side of the window.

#### Step 3: Customize Colors Visually

The theme editor provides:
- **Color pickers** for all theme elements (text, backgrounds, borders, buttons, etc.)
- **Live preview** — changes apply immediately to the UI
- **RGBA sliders** for precise color control
- **Preset themes** you can use as starting points

Adjust the colors until you're happy with how the installer looks with your branding.

#### Step 4: Export the Theme Config

At the bottom of the theme editor panel, there's a **"Copy Theme Config"** button (or similar export option). Click it to copy the complete `ThemeConfig` struct to your clipboard.

The copied output will look like this:

```rust
ThemeConfig {
name: "YourTheme".to_string(),
dark_mode: true,
override_text_color: Some([251, 241, 199, 255]),
override_weak_text_color: Some([124, 111, 100, 255]),
// ... all other color overrides
}
```

#### Step 5: Paste into Your Code

1. Open `src/app.rs` and find the `get_theme_config()` method (around line 136)
2. Replace the entire `ThemeConfig { ... }` block with your copied config
3. Update the `name` field to match your project name
4. Save the file

#### Step 6: Customize Hardcoded UI Colors (Optional)

Some UI elements use hardcoded colors outside the theme system. Search for `Color32::from_rgb` in `app.rs` to find and update:

- **Line ~1036, 1097**: Success message green `(104, 157, 106)`
- **Line ~1397**: Install button green `(104, 157, 106)`
- **Line ~1417**: Cancel button red `(251, 73, 52)`

Replace the RGB values to match your brand colors.

#### Step 7: Test and Push

```bash
# Test your changes
cargo run

# Commit and push to your branch
git add src/app.rs
git commit -m "Update theme colors for [YourProject]"
git push
```

GitHub Actions will automatically build your customized installer for all platforms.

---

### Tips for Theme Customization

> GitHub Actions will automatically build your branch and generate artifacts — **no local build setup required**.
- **Start with a preset**: The theme editor includes several presets (Gruvbox, Solarized, etc.). Pick one close to your brand and adjust from there.
- **Test readability**: Make sure text is readable against backgrounds, especially for secondary text colors.
- **Match your brand**: Use your project's official brand colors for accents, buttons, and highlights.
- **Check all states**: Interact with buttons, dropdowns, and inputs to see hover/active/inactive states.
- **Dark mode only**: The installer currently only supports dark themes. Light theme support is not implemented.

---

> **PLEASE:** Keep the original spruceOS authors in `Cargo.toml` and `Info.plist` for credit. Add your name alongside ours.
> **PLEASE:** Keep the original authors in `Cargo.toml` and `Info.plist` for credit. Add your name alongside ours.
Binary file added assets/Fonts/nunwen.ttf
Binary file not shown.
Loading