# Touchscreen-Friendly Desktop Environments for reTerminal DM4

## Current Setup
- **Screen**: 10-inch, 1280x800 resolution
- **Current DE**: LXDE with Openbox
- **Display Server**: Wayland (with Xwayland)

## Recommended Desktop Environments

### 1. KDE Plasma (Best for Touchscreen) ⭐ RECOMMENDED

**Pros:**
- Excellent touch support with large touch targets
- Built-in on-screen keyboard (Maliit)
- Gesture support
- Scalable UI elements
- Modern, polished interface
- Good performance on Raspberry Pi 5

**Installation:**
```bash
sudo apt-get update
sudo apt-get install kde-plasma-desktop
# Or for full KDE experience:
sudo apt-get install kde-standard
```

**After installation:**
```bash
# Set KDE as default desktop
sudo update-alternatives --config x-session-manager
# Select KDE/Plasma option

# Enable touchscreen optimizations
# In System Settings > Workspace Behavior > Desktop Effects
# Enable touch gestures and adjust touch settings
```

**Size**: ~500-800 MB

---

### 2. GNOME (Good Touch Support)

**Pros:**
- Excellent touch and gesture support
- Large, finger-friendly interface
- Built-in on-screen keyboard (Caribou)
- Modern, tablet-like experience
- Good Wayland support

**Cons:**
- More resource-intensive than LXDE
- May be slower on older Pi models

**Installation:**
```bash
sudo apt-get update
sudo apt-get install gnome-core
# Or full GNOME:
sudo apt-get install gnome
```

**After installation:**
```bash
# Set GNOME as default
sudo update-alternatives --config x-session-manager
# Select GNOME option

# Enable touch optimizations in GNOME Settings
# Settings > Universal Access > Enable on-screen keyboard
```

**Size**: ~1-1.5 GB

---

### 3. XFCE with Touch Optimizations

**Pros:**
- Lightweight but more touch-friendly than LXDE
- Customizable
- Good performance
- Can be configured for touch

**Installation:**
```bash
sudo apt-get update
sudo apt-get install xfce4 xfce4-goodies

# Install on-screen keyboard
sudo apt-get install onboard
```

**Touch optimizations:**
```bash
# Increase icon sizes, touch targets
# Configure in Settings > Appearance > Icons (set to 48px or larger)
# Settings > Panel > Increase panel size
```

**Size**: ~200-300 MB

---

### 4. Phosh (Mobile-First Desktop)

**Pros:**
- Designed specifically for touch devices
- Very lightweight
- Mobile/tablet interface
- Built-in on-screen keyboard

**Cons:**
- Less mature on Raspberry Pi
- May require more configuration

**Installation:**
```bash
sudo apt-get update
sudo apt-get install phosh phosh-tour
```

**Size**: ~100-200 MB

---

### 5. Lomiri (Ubuntu Touch Desktop)

**Pros:**
- Designed for touch from the ground up
- Mobile-first interface
- Gesture-based navigation

**Cons:**
- May not be in Debian repositories
- Requires more setup

**Installation:**
```bash
# May need to add Ubuntu Touch repositories
# Check availability in Debian repos first
```

---

## Comparison Table

| Desktop Environment | Touch Support | Performance | Size | Ease of Setup |
|---------------------|---------------|-------------|------|---------------|
| **KDE Plasma** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | Medium | Easy |
| **GNOME** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | Large | Easy |
| **XFCE** | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | Small | Easy |
| **Phosh** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | Small | Medium |
| **LXDE (Current)** | ⭐⭐ | ⭐⭐⭐⭐⭐ | Very Small | N/A |

---

## Recommended: KDE Plasma

For a 10-inch touchscreen, **KDE Plasma** offers the best balance of:
- Touch-friendliness
- Performance
- Features
- Ease of use

## Installation Steps for KDE Plasma

1. **Install KDE Plasma:**
   ```bash
   sudo apt-get update
   sudo apt-get install kde-plasma-desktop
   ```

2. **Install on-screen keyboard:**
   ```bash
   sudo apt-get install maliit-keyboard
   ```

3. **Set as default desktop:**
   ```bash
   sudo update-alternatives --config x-session-manager
   # Select: /usr/bin/startplasma-wayland or /usr/bin/startplasma-x11
   ```

4. **Configure touch settings:**
   - System Settings > Input Devices > Touchpad/Touchscreen
   - Adjust touch sensitivity and gestures
   - Enable tap-to-click

5. **Enable on-screen keyboard:**
   - System Settings > Input Devices > Virtual Keyboard
   - Enable "Show on-screen keyboard when needed"

6. **Adjust UI scaling:**
   - System Settings > Display and Monitor
   - Set scale to 125% or 150% for better touch targets

7. **Reboot:**
   ```bash
   sudo reboot
   ```

## Switching Back to LXDE

If you want to switch back:
```bash
sudo update-alternatives --config x-session-manager
# Select LXDE option
```

## Touchscreen Calibration (if needed)

```bash
# Install calibration tool
sudo apt-get install xinput-calibrator

# Run calibration
xinput_calibrator

# Follow on-screen instructions to calibrate touch points
```

## Additional Touch Optimizations

### Increase Touch Targets
Edit `~/.gtkrc-2.0` and `~/.config/gtk-3.0/gtk.css`:
```css
* {
    min-width: 44px;
    min-height: 44px;
}
```

### Enable Touch Gestures
- Install `libinput-gestures`:
  ```bash
  sudo apt-get install libinput-gestures
  ```

### Font Scaling
- Increase system font size in desktop settings
- Recommended: 12-14pt for 10-inch screens

## Notes

- **Wayland vs X11**: KDE Plasma and GNOME work well with Wayland, which has better touch support
- **Performance**: KDE Plasma is well-optimized for Raspberry Pi 5
- **Chromium**: Your existing Chromium setup will work with any desktop environment
- **Autostart**: Your autostart configuration will work with any DE

## Resources

- KDE Plasma: https://kde.org/plasma-desktop/
- GNOME: https://www.gnome.org/
- Phosh: https://source.puri.sm/Librem5/phosh
