Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Merge PR #2674: tools: run manager theme operations natively on Windows

Gathin239645f1a16428
diff --cc themes/README.md
index 49d12877e,b49ff05ef..36b21bde6
--- a/themes/README.md
+++ b/themes/README.md
@@@ -14,12 -14,25 +14,28 @@@ powershell -ExecutionPolicy Bypass -Fil
`tools/venv/bin/python -I tools/manage.py list themes` and `list switches` list them from this file, `show <name>` gives one with its
screenshot, and `manage.py set <switch> <value> --theme <your folder>` writes a key into a theme folder of your own
- and pushes it with `theme.sh`. The folder has to be outside this checkout: one under `themes/` or `examples/` is
+ and pushes it with `theme.sh` (`theme.ps1` on Windows). The folder has to be outside this checkout: one under `themes/` or `examples/` is
-refused (copy a theme first), and a `config.json` it cannot read is named before anything is written or pushed.
+refused (copy a theme first), a `config.json` it cannot read is named before anything is written or pushed, and a
+folder that is not there is refused too rather than made - an empty folder of your own is fine, `set` starts the
+`config.json` in it. Pushing replaces the theme on the TV and empties the pictures it pushed before, so a mistyped
+path would leave a one-key theme behind.
+ On Windows, the manager's theme operations need no Bash: they use `pwsh`, or `powershell` if `pwsh` is not on
+ PATH, without loading profiles or changing execution policy. If the computer's policy blocks scripts, the
+ PowerShell error is reported rather than bypassed. From the repository root in PowerShell:
+
+ ```powershell
+ $env:TV_HOST = '192.168.1.50'
+ .\tools\venv\Scripts\python.exe -I .\tools\manage.py list themes
+ .\tools\venv\Scripts\python.exe -I .\tools\manage.py install aurora
+ Copy-Item .\themes\aurora "$HOME\my-theme" -Recurse
+ .\tools\venv\Scripts\python.exe -I .\tools\manage.py set columns 6 --theme "$HOME\my-theme"
+ ```
+
+ `install <theme>` takes only the theme's name, not script arguments. `set` saves the local `config.json`
+ before pushing it; if the push fails, the edit stays on disk and the error says the TV may be only partly
+ updated. Add-ons with custom shell installers still need Bash; this native Windows support covers themes.
+
| Theme | What it does | Screenshot |
|---|---|---|
| `default/` | The built-in look written out as JSON, as a starting point for your own | <img src="default/screenshot.jpg" width="320" alt="default theme"> |
diff --cc tools/manage.py
index b613d5295,1eba3fa0c..781806ba5
--- a/tools/manage.py
+++ b/tools/manage.py
@@@ -21,10 -21,13 +21,15 @@@ JSON object is named before the key is
set's own arguments are read first: a switch without a value, a --theme without the folder behind it, and a word
left over are answered with the usage line and exit 2 before a theme folder is read or written. list, status,
show, install and remove read their own words the same way, before anything is read from this checkout or asked
-of the TV.
+of the TV. A --theme folder that is not there is refused by name, not made: set starts a config.json in a folder
+of your own that exists, and the push it ends with replaces the theme on the TV and empties that theme's
+wallpapers, so a mistyped path would leave a one-key theme behind.
+ On Windows, theme install and set use PowerShell (pwsh, or powershell when pwsh is not on PATH), without loading
+ profiles or changing execution policy. Add-ons with their own shell installer still need Bash. A theme install
+ takes only its name; script arguments belong to add-ons. If set saves the local file but the push fails, it
+ reports that separately: the TV may have received only part of the theme.
+
Exit status: 0 the command ran, 1 a command on the TV or a script this checkout runs failed, 2 the command line
asked for something this script does not do - a command it does not have, or a word the command would drop - which
is answered before the READMEs are read or the TV is asked anything.