2026-05-09 magic4pc: tv-luna-send wrapper, Back+keyboard fix, deploy docs

This commit is contained in:
Alexey Martemyanov
2026-05-09 20:08:07 +06:00
parent 4ec2a77b3c
commit 50953b2654
3 changed files with 141 additions and 97 deletions
+48
View File
@@ -0,0 +1,48 @@
# tv-luna-send.sh — враппер для luna-send на LG TV
Скрипт: `~/Automations/tv-luna-send.sh`
## Проблема
`luna-send` на WebOS через SSH **не выводит результат в stdout** без PTY.
- `ssh root@TV "luna-send -n 1 ..."` — молчит
- `ssh -t root@TV "luna-send -n 1 ..."` — тоже молчит
- `script -q -c "luna-send ..." /tmp/out.txt`**работает**
Причина: luna-send детектирует TTY и отказывается писать в pipe.
## Решение
`script(1)` аллоцирует псевдо-TTY и пишет вывод в файл. Враппер запускает luna-send через script, читает tmpfile (уникальный через $$), фильтрует мусор, удаляет файл.
## Использование
```bash
~/Automations/tv-luna-send.sh [luna-send flags] luna://service/method 'json'
```
Примеры:
```bash
# foreground app
~/Automations/tv-luna-send.sh -n 1 -f luna://com.webos.applicationManager/getForegroundAppInfo '{}'
# закрыть app
~/Automations/tv-luna-send.sh -n 1 -f luna://com.webos.service.applicationmanager/closeByAppId '{"id":"me.wouterdek.magic4pc"}'
# запустить app
~/Automations/tv-luna-send.sh -n 1 -f luna://com.webos.applicationManager/launch '{"id":"me.wouterdek.magic4pc"}'
# статус сервиса
~/Automations/tv-luna-send.sh -n 1 -f luna://me.wouterdek.magic4pc.service/query '{}'
```
Переменная `TV_HOST` переопределяет таргет (default: `root@192.168.1.75`).
## Ограничение
`luna-send -i` (subscribe, бесконечный) не работает через враппер. Для install (`dev/install`) используется прямой ssh+script с polling в deploy.sh.
## Где используется
`~/Developer/magic4pc/webos/deploy.sh` — close, remove, launch.