ActivityWatch / ActivityWatch/aw-tauri

Linux bundles are not self-contained — bundle awatcher + aw-sync so deb/rpm/AppImage work out of the box

Ouverte
#232 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
67
Forks
25
Merge moyen
2 j 2 h
PR mergées (30 j)
13

Description

## Problem

The Linux Tauri artifacts (deb/rpm/AppImage, built via `cargo tauri bundle` in the activitywatch bundle repo) contain **only the aw-tauri binary**. `tauri.conf.json` configures no `bundle.resources` or `externalBin`, so unlike the other platforms, a fresh Linux install launches the tray + embedded aw-server + web UI but **records nothing** — there are no watchers and no aw-sync inside.

Platform comparison (from the v0.14.0b2 draft-release audit):

| Platform | Tauri artifact | Self-contained? |
|---|---|---|
| macOS | DMG via `build_app_tauri.sh` | ✅ modules copied into `Contents/Resources/` |
| Windows | setup.exe via `aw-tauri.iss` | ✅ `dist/activitywatch/*` packed alongside `aw-tauri.exe` |
| Linux | deb/rpm/AppImage via `cargo tauri bundle` | ❌ binary only (13–14MB deb vs 128MB Qt deb) |

The current workaround is the separate ~170MB `activitywatch-tauri-vX-linux-.zip` module pack + `move-to-aw-modules.sh`, which copies watchers into `~/aw-modules/` for discovery. That's an extra manual step most users won't know about, and the zip is easily mistaken for an alternative app bundle.

## Proposal: all-Rust self-contained Linux bundles

Bundle **awatcher + aw-sync** (both Rust, a few MB each) into the Linux artifacts rather than the PyInstaller module trees:

- awatcher covers window+afk watching on both Wayland and X11, so it replaces both Python watchers; `move-to-aw-modules.sh` already treats it as the watcher of choice on Wayland
- keeps bundles small (~20–30MB instead of ~200MB with PyInstaller trees)
- no Python runtime inside the deb/rpm/AppImage at all

Implementation sketch:

1. Add awatcher + aw-sync via `bundle.resources` (or `externalBin` sidecars) in `tauri.conf.json` — the bundle repo already builds both on Linux before `cargo tauri bundle` runs
2. Extend `dirs.rs::get_discovery_paths()` with the installed-resource locations on Linux (deb/rpm install path under `/usr/lib/`, and `$APPDIR` for AppImage) — mirroring the existing macOS `Resources/modules` branch
3. Keep `~/aw-modules/` discovery as-is so power users can still add/override modules (incl. the Python watchers from the zip, which remains available)

Alternative considered: bundling the full PyInstaller trees via `bundle.resources` (matches macOS/Windows content exactly) — works but inflates every Linux artifact by ~170MB and drags a Python runtime into otherwise-pure-Rust bundles.

Context: found while auditing the v0.14.0b2 draft release assets in the bundle repo (all four macOS DMGs + Windows setup are self-contained; Linux is the odd one out).

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.