# Crustace

Crustace is the Liberux desktop shell, built with Rust and iced 0.13. Designed for mobile-first (Liberux NEXX smartphone) but also works in desktop mode.

## Features

### Top Bar
- Clock (12h or 24h format)
- Battery indicator with percentage
- WiFi status and signal strength
- Cellular network status (5G/LTE/3G)
- Bluetooth status
- Notification counter

### Quick Settings Panel
- WiFi toggle
- Bluetooth toggle
- Airplane mode toggle
- Brightness slider
- Volume slider with mute
- Link to full Settings app

### App Launcher
- Grid layout with app icons
- Search functionality
- Automatic .desktop file scanning
- Supports Flatpak apps
- Responsive columns (4 mobile, 8 desktop)

### Notifications
- Notification list with timestamps
- Dismiss individual or all
- Action buttons support
- App name and icon

## Building

```bash
cargo build --release
```

## Running

```bash
./target/release/crustace
```

## Configuration

Configuration file: `~/.config/eydos/crustace.toml`

```toml
[shell]
lock_timeout_secs = 300
screen_off_timeout_secs = 600
theme = "auto"  # auto, light, or dark

[display]
mode = "auto"  # mobile, desktop, or auto

# Favorites bar shown under every homescreen page. `app_id` is the .desktop
# filename (or .apk id once the Android translation layer is installed).
[[dock.items]]
type = "app"
app_id = "firefox.desktop"

[[dock.items]]
type = "app"
app_id = "org.gnome.Console.desktop"

# Mobile homescreen — one or more pages, each an MxN grid of items placed
# at explicit [col, row] cells. Apps occupy one cell; widgets (future) span
# AxB cells.
[[mobile.pages]]
[[mobile.pages.items]]
type = "app"
app_id = "signal-desktop.desktop"
cell = [ 0, 0 ]

# Desktop homescreen — a single page (by design for now).
[[desktop.items]]
type = "app"
app_id = "org.gnome.Nautilus.desktop"
cell = [ 0, 0 ]
```

## Architecture

```
crustace/
├── src/
│   ├── app.rs           # Main application, message handling
│   ├── config.rs        # Configuration loading/saving
│   ├── panels/
│   │   ├── top_bar.rs   # Status bar (via liberux-topbar)
│   │   └── quick_settings.rs
│   ├── launcher/
│   │   ├── mod.rs       # App launcher
│   │   ├── app_grid.rs  # .desktop file scanning
│   │   └── search.rs    # Search functionality
│   ├── notifications/   # Notification system
│   ├── system/          # System state (battery, wifi, etc.)
│   ├── widgets/         # Reusable widgets
│   └── lockscreen/      # Lock screen
└── assets/
```

## System Integration

The shell uses:
- **NetworkManager** (nmcli) for WiFi control
- **ModemManager** (mmcli) for cellular
- **BlueZ** (bluetoothctl) for Bluetooth
- **PipeWire/PulseAudio** for audio
- **sysfs** for battery and brightness

## License

GPL-3.0
