# Motte

**Under construction:** Motte is an early Linux desktop USB formatter and ISO flasher. Verify every selected target carefully; flash and format actions are destructive.

Motte is a Rust desktop app for preparing USB drives and writing Linux install images.

It focuses on the Linux workflow for creating Arch Linux install media:

- Detect removable USB drives with `lsblk`.
- Flash `.iso` or `.img` files directly to a selected USB device.
- Pick an ISO with the built-in Image Vault browser, paste a path, or drag a file into the window.
- Wipe old signatures before flashing when requested.
- Format a USB drive as FAT32, exFAT, or ext4 for normal storage.
- Show guarded destructive-action confirmation, live logs, and write progress.
- Includes local copied KnottDynamics SVG assets under `assets/`; the live UI uses a simpler line-art mark and monochrome procedural background.

## Run

```bash
cargo run
```

Motte is designed for Linux desktops. The window scales down for laptop displays and the main interface scrolls vertically if the available height is small.

## Workflow

1. Plug in a USB drive.
2. Select the target drive card in Motte.
3. Choose `Wipe + Flash`, `Flash ISO`, or `Format Drive`.
4. Select an Arch Linux ISO with the Image Vault browser, paste a path, or drag an image into the window.
5. Check the target acknowledgement box.
6. Press `Review + Submit` and approve the final destructive-action dialog.

## Interface

- Monochrome KnottDynamics-inspired HUD styling.
- Procedural black-and-white botany/fractal background animation.
- Built-in Image Vault browser, avoiding native file-dialog crashes.
- Responsive compact mode for smaller laptop screens.
- Live telemetry log and write-progress display.

## System Tools

Motte shells out to standard Linux tools for destructive operations:

- `lsblk`
- `pkexec` for privilege escalation, unless `MOTTE_NO_PKEXEC=1` is set
- `udisksctl` for desktop-aware unmounting when available
- `umount`
- `wipefs`
- `dd`
- `parted`
- `partprobe`
- `udevadm`
- `blockdev`
- `mkfs.vfat` or `mkfs.fat`, `mkfs.exfat`, or `mkfs.ext4` for format mode

Install the matching packages for your distro. For Arch-based systems this usually means `polkit`, `udisks2`, `util-linux`, `parted`, `dosfstools`, `exfatprogs`, and `e2fsprogs`. In format mode, Motte attempts to install missing formatter packages through `pacman`, `apt-get`, `dnf`, or `zypper` after authorization.

## Safety

Motte only lists disks that `lsblk` reports as removable, hotplug, or USB transport devices. Every flash or format action still destroys data on the selected target. Verify the `/dev/...` path, check the target acknowledgement box, then approve the final confirmation dialog before starting.

## Test

```bash
cargo fmt --check
cargo test
cargo check
```

## Package

```bash
cargo package
cargo publish
```

Publishing requires a crates.io account and a configured Cargo registry token.

## License

MIT
