Skip to content

feat(linux): add desktop app port - #8415

Closed
ZachL111 wants to merge 6 commits into
BasedHardware:mainfrom
ZachL111:zach/linux-desktop-app
Closed

ZachL111 wants to merge 6 commits into
BasedHardware:mainfrom
ZachL111:zach/linux-desktop-app

Conversation

@ZachL111

@ZachL111 ZachL111 commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Added a standalone desktop/Linux Electron app for Omi on Linux.
  • Ported the desktop experience over with sign in, the floating bar, chat, conversations, memories, tasks, dashboard, goals, graph, insights, Rewind, Focus, the proactive assistant, apps, settings, and tray support.
  • Added the Linux-specific main-process pieces for PulseAudio/PipeWire monitor capture, Tesseract OCR, libsecret-backed secret storage, autostart through a .desktop file, omi-computer:// callback handling, and AppImage/.deb packaging.
  • Added README docs, a port plan, screenshots, build config, and a Linux package lockfile.

Why

This splits the Linux desktop work out from the combined desktop branch so the PR only touches desktop/Linux. No Windows files and no backend files are included here.

The goal is to give Linux the same desktop surface as the Mac and Windows apps while keeping the first review focused on the platform port itself.

Notes

  • The first cut targets X11. Wayland can still use the main window and portal-based screen capture, but global shortcuts, always-on-top behavior, and floating window positioning are limited by the compositor.
  • System audio uses a PulseAudio/PipeWire monitor source when one is available and falls back to microphone-only capture otherwise.
  • Rewind OCR uses the Tesseract CLI sidecar and keeps the indexed screen text local in SQLite FTS5.
  • I kept this split to the Linux app files only so it does not overlap the Windows desktop branch.

Checks

  • npm install --ignore-scripts
  • npm run typecheck
  • npm run build
  • git diff --check

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 124 files

Confidence score: 3/5

  • desktop/Linux/PLAN-LINUX.md documents autostart using a hardcoded ~/.config/autostart path instead of $XDG_CONFIG_HOME/autostart, which can cause launch-at-login setup to silently fail for users with non-default XDG config locations; align the path handling with the XDG autostart spec before merging to avoid a user-facing Linux regression.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/Linux/PLAN-LINUX.md">

<violation number="1" location="desktop/Linux/PLAN-LINUX.md:33">
P2: Autostart path hardcodes `~/.config/autostart` instead of resolving `$XDG_CONFIG_HOME/autostart` per the freedesktop XDG autostart spec, causing launch-at-login to silently fail for users with custom XDG config directories.</violation>
</file>

Note: This PR contains a large number of files. cubic only reviews up to 40 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

Comment thread desktop/Linux/src/main/fileIndex.ts Resolved
Comment thread desktop/Linux/src/main/rewind/ocr.ts Resolved
Comment thread desktop/Linux/scripts/pkg-shoot.cjs Resolved
Comment thread desktop/Linux/src/main/settings.ts Resolved
Comment thread desktop/Linux/src/main/settings.ts Resolved
Comment thread desktop/Linux/src/main/updater.ts Resolved
Comment thread desktop/Linux/src/main/updater.ts Resolved
Comment thread desktop/Linux/src/main/index.ts Resolved
Comment thread desktop/Linux/src/main/fileIndex.ts Resolved
@ZachL111
ZachL111 force-pushed the zach/linux-desktop-app branch 2 times, most recently from bbaba36 to 9cdfcd4 Compare June 26, 2026 23:44
@ZachL111
ZachL111 force-pushed the zach/linux-desktop-app branch from 9cdfcd4 to e0aefce Compare June 26, 2026 23:48
@ZachL111

Copy link
Copy Markdown
Contributor Author

Pushed a cleanup pass for the Cubic notes.

Covered the main runtime issues and the smaller script/doc ones:

  • OCR worker spawn errors now fail gracefully, and Tesseract calls have timeouts.
  • File indexing now uses async fs calls and yields during traversal instead of recursive sync scanning on the main process.
  • Launch-at-login now resolves the XDG config dir, quotes the .desktop Exec path, and keeps stored state aligned if the OS write fails.
  • Loopback capture arming is scoped to the exact renderer process and frame that requested it.
  • The goal celebration timer no longer depends on a cleanup path that can be triggered by clearing the store signal.
  • The PCM worklet now uses a ring buffer and flushes the final partial frame with silence padding on stop.
  • CDP screenshot/probe scripts now reject bad /json/list responses, protocol errors, socket closes, and timeouts.
  • Dotenv ignore coverage and the Linux plan wording were tightened.

Checks I reran:

  • node --check desktop/Linux/scripts/pkg-shoot.cjs
  • node --check desktop/Linux/scripts/probe.cjs
  • node --check desktop/Linux/scripts/cdp-screenshot.cjs
  • node --check desktop/Linux/scripts/inject-shoot.cjs
  • node --check desktop/Linux/scripts/grab-video-frames.cjs
  • npm run typecheck
  • npm run build
  • git diff --check

@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge security-review Touches auth, provider routing, secrets, or security-sensitive surfaces dependency-review Touches dependencies or lockfiles; needs dependency review workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior needs-tests PR introduces logic that should be covered by tests labels Jun 27, 2026

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting the Linux desktop work into its own desktop/Linux tree — this is a substantial and useful direction, and the Linux-specific notes around X11/Wayland, PipeWire/PulseAudio, libsecret, autostart, and Tesseract are appreciated.

I’m requesting changes before this can move forward, mostly because this PR introduces a new desktop distribution surface with updater/auth/audio/screen-capture/dependency behavior and needs human maintainer/product review before merge.

Blocking issues I found:

  1. desktop/Linux/electron-builder.yml configures publish to owner: ZachL111 / repo: omi. In a packaged AppImage, desktop/Linux/src/main/updater.ts uses electron-updater against that publish feed. If this were merged as-is, Linux clients could check/download updates from the contributor fork rather than the official BasedHardware release channel. Please remove/disable auto-update for this PR or point it only at the official release source once maintainers confirm the intended Linux release flow.

  2. desktop/Linux/src/main/apiProxy.ts still sends X-App-Platform: windows. The Linux app should not identify as Windows when talking to the backend; this can skew platform-specific backend behavior, analytics, support/debugging, or feature gates. Please change this to the intended Linux platform value and verify any backend expectations.

  3. This is a very large first-cut feature (124 files, new Electron app, lockfile, updater config, auth/token storage, BYOK headers, Rewind OCR/indexing, screen/audio capture, WebSocket bridges, packaging). The current CI signal shown here is only the repo lint/format check; it does not independently prove the new Linux package typechecks/builds/packages or that the sensitive desktop paths behave safely. Please add/point to maintainers’ preferred validation for desktop/Linux (npm run typecheck, npm run build, packaging smoke test, and any auth/capture/updater sanity checks) so reviewers can reproduce it.

Given the size and the new security/privacy/release surfaces, I’m also leaving this for human maintainer review rather than treating it as an auto-approvable PR. Once the updater source and platform header are fixed and there is reproducible validation, this will be much easier to review constructively.

@ZachL111

Copy link
Copy Markdown
Contributor Author

Will do, looking into both this and security PR as well.

@ZachL111

Copy link
Copy Markdown
Contributor Author

Thanks David, agreed on these.

Pushed a follow-up that:

  • Removes the ZachL111 GitHub publish feed and disables Linux auto-update until maintainers choose the official release channel.
  • Changes the Linux client to send X-App-Platform: linux, with the small backend normalization needed so Linux records as desktop activity and follows the desktop plan/paywall gates.
  • Changes the MCP key label from windows-desktop to linux-desktop.
  • Adds desktop/Linux/docs/VALIDATION.md so the Linux typecheck/build/package/smoke path is reproducible.
  • Adds desktopName plus syncDesktopName after the packaging smoke surfaced the Linux desktop association warning.

Validation I ran:

  • npm ci --ignore-scripts
  • npm run typecheck
  • npm run build
  • python -m pytest tests/unit/test_paywall_reconnect_gate.py tests/unit/test_subscription_restructure.py tests/unit/test_user_platform_aliases.py
  • git diff --check

I also tried npm run dist:appimage. It got through the Vite build, native rebuild, Electron Linux unpack, and AppImage setup, then failed on this Windows host at the final AppImage symlink step with EPERM. So the remaining package smoke still needs a Linux host, but the contributor fork updater issue and platform header issue are fixed now.

@ZachL111

Copy link
Copy Markdown
Contributor Author

Small follow-up: the first run caught Black formatting on the new platform-alias test, so I pushed that formatting-only fix too. Current checks are green now: Lint & Format, Hermetic Backend E2E, and Cubic.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up. The earlier high-risk blockers I raised look addressed in this head: the contributor-fork publish/update feed is gone, Linux auto-update is disabled until maintainers choose the official channel, the desktop API proxy now sends X-App-Platform: linux, and there is now a Linux validation checklist plus backend coverage for the Linux platform alias/paywall-plan behavior.

I’m leaving this as a positive maintainer signal rather than an approval because the PR is still a large new desktop distribution surface (Electron app, lockfile/postinstall/native rebuilds, auth/token/BYOK handling, screen/audio capture, Rewind OCR/local indexing, protocol handling, packaging, and backend platform behavior). It still needs human maintainer/product/security/release review and a Linux-host package smoke before merge, especially since the contributor-reported AppImage package attempt did not complete on their host.

No additional blocking issue found in this static follow-up pass, but formal auto-approval remains disallowed for this PR under the maintainer policy.

@ZachL111

Copy link
Copy Markdown
Contributor Author

Thanks for the re-review and for confirming the blockers are cleared. To recap where this head landed: the contributor-fork publish feed is removed and Linux auto-update is disabled until maintainers pick the official release channel, the API proxy sends X-App-Platform: linux, and there is a Linux validation checklist plus backend coverage for the platform alias and paywall-plan behavior.

Agreed it should stay with human maintainer, product, security, and release review. The one verification gap I want to be honest about: I could not complete an AppImage package smoke on my own host, so a maintainer or CI running an actual Linux package build is the right gate before merge, not my local run.

If it helps the team, I am happy to split the non-runtime pieces (the backend platform-alias handling and the docs/checklist) into a smaller PR that can land independently of the full desktop surface. Whatever is easiest to review.

# Conflicts:
#	backend/database/users.py
#	backend/tests/unit/test_subscription_restructure.py

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I re-reviewed the current head (0e7ea002bf4ecce5243d119447fcc3c096a89138) statically and did not execute the Linux app code.

I’m going to keep this in changes-requested / human-review-required state for two concrete gates:

  1. The current required Backend unit suite is failing. From the GitHub job, tests/unit/test_lock_bypass_fixes.py fails in TestScheduledDailySummaryLockFilter because the test patches utils.other.notifications.is_trial_paywalled, but that attribute no longer exists in utils.other.notifications. This may be a main-branch/test-drift issue rather than caused by the Linux port, but this PR still needs a green required suite before merge.

  2. npm audit --package-lock-only in desktop/Linux flags the packaged Electron runtime as high severity: [email protected] is in the vulnerable range (<=39.8.4, including GHSA-532v-xpq5-8h95). Even though Electron is listed under devDependencies, it is the runtime that gets packaged into the desktop app, so this should be updated/pinned to a non-vulnerable Electron line before shipping a new desktop distribution surface. npm audit --omit=dev is clean, so the remaining finding is specifically the Electron runtime/dev packaging dependency.

The earlier high-risk updater/platform-header blockers still look addressed: no contributor fork publish feed, Linux auto-update remains disabled pending an official release channel, the API proxy sends X-App-Platform: linux, and backend platform/paywall coverage exists. This is still a large auth/BYOK/screen-capture/OCR/local-indexing/package surface, so formal approval remains disallowed and human maintainer/security/release review is still needed.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I re-reviewed the current head (490da46da5e570843ccb840de84a6905163e72a9) statically and did not execute the Linux app code.

Good news: the required GitHub checks are green on this head, including Backend unit suite, so the previous backend-test gate appears cleared. The earlier high-risk updater/platform-header issues still look addressed: Linux auto-update remains disabled until maintainers choose an official release channel, there is no contributor-fork publish feed in the Linux builder config, and the API proxy sends X-App-Platform: linux with backend coverage for the Linux desktop/paywall behavior.

I’m still keeping this in changes-requested / human-review-required state for the dependency/release gate: npm audit --package-lock-only in desktop/Linux still reports a high-severity Electron runtime advisory for the packaged Electron version ([email protected], vulnerable range <=39.8.4, including GHSA-532v-xpq5-8h95 and related Electron advisories). npm audit --package-lock-only --omit=dev is clean, but in an Electron desktop app the electron devDependency is the runtime that gets packaged and shipped, so this should be updated/pinned to a non-vulnerable Electron line before this becomes a new Linux distribution surface.

Given the size and sensitivity of this PR (new Electron app, lockfile/native rebuilds, auth/token/BYOK handling, protocol handling, screen/audio capture, Rewind OCR/local indexing, and packaging), formal auto-approval remains disallowed under the maintainer policy. After the Electron runtime advisory is resolved, I’d still want human maintainer/security/release review plus a Linux-host package smoke before merge.

…e Linux port

npm audit --package-lock-only on desktop/Linux reported 1 high severity vulnerability against
the packaged electron 38.8.6, covering four advisories in the vulnerable range <=39.8.4:

- GHSA-532v-xpq5-8h95  use-after-free in the offscreen child window paint callback
- GHSA-8x5q-pvf5-64mp  use-after-free in the offscreen shared texture release() callback
- GHSA-f37v-82c4-4x64  crash in clipboard.readImage() on malformed clipboard image data
- GHSA-f3pv-wv63-48x8  named window.open targets not scoped to the opener's browsing context

This matters more here than in an ordinary dependency bump because this PR is what makes Linux
a distribution surface for the app, so the shipped runtime should not start out on a known
vulnerable line.

devDependencies electron is moved from ^38.2.0 to ^43.1.1 and the lockfile is regenerated. 43.x
is what npm audit itself resolves to as the fix, and it is a supported line still receiving
security updates, which a 39.8.5 style patch pin would not be.

The lockfile churn is confined to electron's own dependency subtree (@electron/get, extract-zip,
yauzl, fd-slicer, pend, buffer-crc32, fs-extra and electron's bundled @types/node). No
production dependency moved: better-sqlite3, electron-updater, ws, react, vite and typescript
are all unchanged.

Verification (run in desktop/Linux):
- npm audit --package-lock-only before: 1 high severity vulnerability, 4 advisories
- npm audit --package-lock-only after: found 0 vulnerabilities
- npm run typecheck: clean, both tsconfig.web.json and tsconfig.node.json, 0 errors. This is
  the meaningful check for a five-major bump, since the app's main process uses
  desktopCapturer, safeStorage, powerMonitor, globalShortcut, session, Tray and screen, and
  removed or changed API signatures would surface here
- npm run build (electron-vite build): succeeds. Main 26 modules, preload 1 module, renderer
  241 modules, all chunks emitted

Not verified: the packaged Linux app was not launched or smoke tested. That needs a Linux host
and was not possible from this machine, so the AppImage and deb packaging paths and the runtime
behaviour of the bumped Electron still need a check on Linux before this lands.
@ZachL111

Copy link
Copy Markdown
Contributor Author

Electron is updated to 43.1.1 in 9fc8265, which clears the advisory you flagged.

Before, on electron 38.8.6, npm audit --package-lock-only in desktop/Linux reported 1 high
severity vulnerability covering four advisories in the <=39.8.4 range: GHSA-532v-xpq5-8h95,
GHSA-8x5q-pvf5-64mp, GHSA-f37v-82c4-4x64 and GHSA-f3pv-wv63-48x8. After the bump it reports
found 0 vulnerabilities.

I went to 43.x rather than pinning something like 39.8.5 because 43 is what npm audit itself
resolves to as the fix, and it is a supported line still receiving security updates. Your point
that this should not ship a known vulnerable runtime on a new distribution surface is the reason
it is worth taking the larger jump.

The lockfile churn is contained to electron's own subtree (@electron/get, extract-zip, yauzl,
fd-slicer, pend, buffer-crc32, fs-extra, electron's bundled @types/node). No production
dependency moved: better-sqlite3, electron-updater, ws, react, vite and typescript are
unchanged.

On the breaking-change risk from five majors, what I could check passes:

  • npm run typecheck: clean on both tsconfig.web.json and tsconfig.node.json, 0 errors. The
    main process uses desktopCapturer, safeStorage, powerMonitor, globalShortcut, session, Tray
    and screen, so removed or changed signatures would surface here.
  • npm run build (electron-vite build): succeeds, main 26 modules, preload 1, renderer 241, all
    chunks emitted.

What I have not done, and what still needs doing before this lands: I did not launch or smoke
test the packaged Linux app. That needs a Linux host and I could not do it from this machine, so
the AppImage and deb packaging paths and the runtime behaviour on the new Electron are still
unverified. Treating that as a required step rather than a formality seems right given the size
of the jump, and it lines up with the maintainer and security review you asked for.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating Electron. I re-reviewed the current head (9fc826588f19d176cc770bac22b7d87a716ee4fc) in an isolated checkout and did not run the app with user credentials.

Good progress: the earlier high-severity Electron audit blocker looks resolved. In desktop/Linux, both npm audit --package-lock-only and npm audit --package-lock-only --omit=dev now report found 0 vulnerabilities, and npm run typecheck plus npm run build pass on this head. The previous updater/platform-header fixes also still look intact: Linux auto-update is disabled until maintainers choose an official channel, there is no contributor-fork publish feed in electron-builder.yml, and the API proxy sends X-App-Platform: linux.

I’m still requesting changes because the documented/package target does not currently build for .deb. On a Linux host, after npm ci --ignore-scripts, I ran npm run dist:deb; it completed the Vite build, native rebuild, Electron unpack, and then failed in electron-builder’s deb target with:

Please specify project homepage
Please specify author 'email' in the application package.json
It is required to set Linux .deb package maintainer. Or you can set maintainer in the custom linux options.

Since desktop/Linux/docs/VALIDATION.md explicitly lists npm run dist:deb as part of release validation, please add the required package metadata (homepage and Linux deb maintainer/author email, or the equivalent electron-builder Linux options) and rerun the package smoke on Linux. I could not run the backend unit tests here because this checkout lacks backend Python dependencies (pydantic missing during collection), but the Linux frontend/package checks above are enough to reproduce this blocker.

Given the size and sensitivity of this PR (new Electron distribution surface, auth/token/BYOK handling, screen/audio capture, Rewind OCR/local indexing, protocol handling, dependency/native rebuilds, and release packaging), formal auto-approval remains disallowed. After the .deb package gate is fixed, this should still get human maintainer/security/release review before merge.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@undivisible

Copy link
Copy Markdown
Collaborator

Superseded by the consolidated Linux PR: #10096

Closing the forked desktop/Linux tree approach. Best platform bits (PulseAudio loopback flag + deb runtime depends) were ported into #10096; the rest of the app surface stays on the shared desktop/windows tree.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @ZachL111 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

undivisible added a commit that referenced this pull request Jul 20, 2026
Consolidate Linux desktop work as platform seams on desktop/windows
(not a forked desktop/linux tree).

From #9503 (primary):
- X11 active-window via xprop + /proc
- Tesseract OCR helper speaking win-ocr-helper protocol
- XWayland default + PipeWire capturer
- Wayland continuous Rewind default off
- AppImage+deb targets (no snap)

From #8415:
- PulseaudioLoopbackForScreenShare for system-audio loopback
- deb runtime depends (tesseract, libnotify, libxss)

From #9963:
- architecture validation only (forked tree rejected as drift)

Also: lazy-require koffi so Linux import of nativeForeground never
loads the Win32 native module (fixes linux unit tests off-Windows).

Verification: vitest 21/21 on linuxForeground, nativeForeground
linux/degrade, rewindSettings wayland.

Failure-Class: none

Co-authored-by: velinxs <[email protected]>
Co-authored-by: ZachL111 <[email protected]>
Co-authored-by: palontologist <[email protected]>
undivisible added a commit that referenced this pull request Jul 20, 2026
…10110)

## Summary
Adds a scoped `// eslint-disable-next-line
@typescript-eslint/no-require-imports` above the two lazy
`require('koffi')` calls (nativeForeground.ts:45,
userAssistRegistry.ts:46) so the **Desktop Windows CI / Typecheck · Lint
· Test** check goes green on #10096.

The lazy require is the right idea (keeps `nativeForeground` importable
off-Windows); it just trips the `no-require-imports` rule. This is the
exact fix the maintainer requested in the #10096 review.

## Test plan
- `cd desktop/windows && npx eslint src/main/usage/nativeForeground.ts
src/main/usage/userAssistRegistry.ts` → no `no-require-imports` errors.
- Part of the consolidated Linux PR #10096 (supersedes
#9503/#9963/#8415).

## Notes
Pushed from the `consolidation/linux-electron` HEAD. Intended to be
merged into that branch (or squashed into its feat commit) so #10096 can
land.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/10110?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
undivisible added a commit that referenced this pull request Jul 21, 2026
Consolidate Linux desktop work as platform seams on desktop/windows
(not a forked desktop/linux tree).

From #9503 (primary):
- X11 active-window via xprop + /proc
- Tesseract OCR helper speaking win-ocr-helper protocol
- XWayland default + PipeWire capturer
- Wayland continuous Rewind default off
- AppImage+deb targets (no snap)

From #8415:
- PulseaudioLoopbackForScreenShare for system-audio loopback
- deb runtime depends (tesseract, libnotify, libxss)

From #9963:
- architecture validation only (forked tree rejected as drift)

Also: lazy-require koffi so Linux import of nativeForeground never
loads the Win32 native module (fixes linux unit tests off-Windows).

Verification: vitest 21/21 on linuxForeground, nativeForeground
linux/degrade, rewindSettings wayland.

Failure-Class: none

Co-authored-by: velinxs <[email protected]>
Co-authored-by: ZachL111 <[email protected]>
Co-authored-by: palontologist <[email protected]>
undivisible added a commit that referenced this pull request Jul 21, 2026
Consolidate Linux desktop work as platform seams on desktop/windows
(not a forked desktop/linux tree).

From #9503 (primary):
- X11 active-window via xprop + /proc
- Tesseract OCR helper speaking win-ocr-helper protocol
- XWayland default + PipeWire capturer
- Wayland continuous Rewind default off
- AppImage+deb targets (no snap)

From #8415:
- PulseaudioLoopbackForScreenShare for system-audio loopback
- deb runtime depends (tesseract, libnotify, libxss)

From #9963:
- architecture validation only (forked tree rejected as drift)

Also: lazy-require koffi so Linux import of nativeForeground never
loads the Win32 native module (fixes linux unit tests off-Windows).

Verification: vitest 21/21 on linuxForeground, nativeForeground
linux/degrade, rewindSettings wayland.

Failure-Class: none

Co-authored-by: velinxs <[email protected]>
Co-authored-by: ZachL111 <[email protected]>
Co-authored-by: palontologist <[email protected]>
Git-on-my-level added a commit that referenced this pull request Jul 25, 2026
 #8415) (#10096)

## Summary

Consolidates the three open Linux desktop PRs into one landable path:

| PR | Approach | Verdict |
|---|---|---|
| #9503 | Platform seams on `desktop/windows` (+473) | **Primary** —
keep |
| #8415 | Forked `desktop/Linux` tree (+24k) | Port **Pulse loopback +
deb depends** only |
| #9963 | Forked `desktop/linux` tree (+58k, ~75% Windows copy) | Reject
fork; product extras (sign avatar / monologur) stay follow-ups |

Architecture: **one Electron tree** (`desktop/windows`) with
`process.platform` branches. No `desktop/linux` / `desktop/Linux` fork —
those drift from Windows immediately and double maintenance.

### What lands

**From #9503**
- X11 active-window (`linuxForeground.ts` via `xprop` + `/proc`)
- Tesseract OCR helper speaking `win-ocr-helper` stdio protocol
(`resources/linux-ocr-helper/omi-ocr-helper`)
- XWayland default (`OMI_OZONE=wayland` override) + PipeWire capturer
- Wayland: continuous Rewind capture defaults **off**
- Linux targets: AppImage + deb (snap dropped — confinement blocks
xprop/tesseract)

**From #8415**
- `PulseaudioLoopbackForScreenShare` for system-audio loopback
- `.deb` depends: `tesseract-ocr`, `tesseract-ocr-eng`, `libnotify4`,
`libxss1`

**Fix on top of #9503**
- Lazy-`require('koffi')` so Linux import of `nativeForeground` never
loads Win32 native module (unit tests were broken off-Windows)

## Tests
```
cd desktop/windows
npx vitest run \
  src/main/usage/linuxForeground.test.ts \
  src/main/usage/nativeForeground.linux.test.ts \
  src/main/usage/nativeForeground.degrade.test.ts \
  src/main/rewind/rewindSettings.wayland.test.ts
# → 22/21+ focused Linux tests (includes foregroundMonitor.linux)
```

## Product invariants
None. Path globs under `desktop/windows` for Linux seams only.

## Credits

Consolidated from community PRs (code selected into `desktop/windows`
seams; forked trees not re-merged):

| PR | Author | Role |
|---|---|---|
| #9503 | @velinxs | Primary Linux platform seams (X11, OCR helper,
XWayland, Wayland Rewind default) |
| #8415 | @ZachL111 | Pulse loopback flag + deb depends (from Linux
packaging work) |
| #9963 | @palontologist | Architecture reference; full `desktop/linux`
fork not adopted |

Git trailers on the feat commit: `Co-authored-by` for all three.

Failure-Class: none

Closes #9503
Closes #9963
Closes #8415


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/10096?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency-review Touches dependencies or lockfiles; needs dependency review needs-maintainer-review Needs a human maintainer to sign off before merge needs-tests PR introduces logic that should be covered by tests security-review Touches auth, provider routing, secrets, or security-sensitive surfaces workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants