[2026-05-29] hermes kraken+eagle+deployment patterns, htpc magic4pc+steam emulators, tv luna-send

This commit is contained in:
Alexey Martemyanov
2026-05-29 03:03:06 +06:00
parent 67fee70ba3
commit cea0db4168
10 changed files with 563 additions and 9 deletions
+95 -2
View File
@@ -1,15 +1,18 @@
---
title: HTPC — magic4pc (LG Magic Remote)
created: '2026-05-28'
updated: '2026-05-28'
updated: '2026-05-29'
type: tech
namespace: family
tags: [htpc, how-to, pitfalls]
sources: [family/how-to/htpc-magic4pc.md]
sources:
- family/how-to/htpc-magic4pc.md
- family/how-to/magic4pc-webos.md
confidence: medium
related:
- "[[htpc-bazzite-proton]]"
- "[[tech/htpc-steam-emulators]]"
- "[[tech/tv-luna-send]]"
---
# HTPC — magic4pc (LG Magic Remote)
@@ -96,7 +99,97 @@ Sudoers rule (no-password systemctl):
bazzite ALL=(ALL) NOPASSWD: /usr/bin/systemctl
```
## WebOS TV App — Build & Deploy
The TV-side is a React/Enact WebOS app + Node.js service bundled into
an IPK. Sources: `~/Developer/magic4pc/webos/`.
### Build
```bash
cd ~/Developer/magic4pc/webos
NODE_OPTIONS=--openssl-legacy-provider npm run build
```
**Pitfall:** `--openssl-legacy-provider` is required — the old webpack
is incompatible with Node.js 25+.
### Package IPK
```bash
/Users/admin/webOS_TV_SDK/CLI/bin/ares-package dist/ service/ --outdir .
```
**Pitfall:** both `dist/` and `service/` arguments are required —
omitting `service/` excludes the Node.js service from the IPK.
**Pitfall:** `npm run package` = `ares-package -n` (unsigned) — TV
rejects unsigned packages. Use the SDK command directly.
### Deploy (deploy.sh)
```bash
cd ~/Developer/magic4pc/webos && ./deploy.sh
```
Script flow: build → package → scp → close → remove → install → launch.
Uses [[tech/tv-luna-send]] wrapper for close/remove/launch.
For install (subscribe mode) — direct `ssh+script` with polling on
`"state":"installed"`.
**Pitfall:** `ares-install` / `ares-launch` are unreliable — they don't
wait for completion. Use `luna-send dev/install` via `script` wrapper.
### Version in UI
Displayed as `1.1.0 (YYYY-MM-DD HH:MM)` — injected by webpack at
build time via `process.env.BUILD_DATE`.
## Auto-launch on Boot/Wake
Magic4pc launches a configured app when the TV boots or wakes.
| File | Location | Purpose |
|------|----------|---------|
| `magic4pc-settings` | PERSISTENT_DIR | Selected app ID |
| `magic4pc-last-app` | PERSISTENT_DIR | Last foreground app |
| `magic4pc-run-state` | `/tmp/` | `running` after first launch |
`PERSISTENT_DIR = /media/developer/apps/usr/palm/services/me.wouterdek.magic4pc.service`
Logic:
- **Boot/wake:** `/tmp` is cleared → no `run-state``freshStart=true`
→ launches configured app
- **Manual launch:** `run-state=running` already present → skips auto-launch
The `init.d` script on TV (`/var/lib/webosbrew/init.d/magic4pc`) removes
`run-state` on suspend so wake triggers fresh launch. Always edit in
repo (`tv-scripts/init.d-magic4pc.sh`), never directly on TV.
## WebOS Back Key + System Keyboard
When the system keyboard is open, **Back #1** is consumed by the OS
(closes keyboard) — the `keydown` DOM event and `onButtonDown` are
**not** fired. **Back #2** arrives normally.
Fix used in `MainPanel.js` (`_kbWasOpen` flag):
```js
// Input.onActivate:
this._kbWasOpen = true;
// onButtonDown on Back:
if (this.state.wolMacActive || this._kbWasOpen) {
this._kbWasOpen = false;
return; // suppress panel close
}
```
Approaches that don't work: `Popup.noAutoDismiss`, timeout heuristic,
polling `document.activeElement` (keyboard is a system overlay, focus
never moves to INPUT).
## See Also
- [[htpc-bazzite-proton]] — Proton game compatibility on this HTPC
- [[tech/htpc-steam-emulators]] — Steam, emulators, gamepad config
- [[tech/tv-luna-send]] — luna-send SSH wrapper for WebOS TV commands