Skip to content

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

themes: a screenshot in every theme folder, required for new themes

מקס חייםa4fb59099728
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index ed59162c9..1384e2e8a 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -14,3 +14,7 @@
- [ ] No network, no background service, no new permission
- [ ] New strings in `values/strings.xml` and the other `values-*` folders
- [ ] Anything TV-specific is in `config.xml` or a theme, not in code
+
+### If this adds or changes a theme
+- [ ] `themes/<name>/config.json` and `themes/<name>/screenshot.jpg`: Home on a real TV with the theme, 1280×720 JPEG under 300 KB
+- [ ] A row in `themes/README.md` showing the screenshot
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 85857d00d..3b77480ab 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -73,6 +73,9 @@ Ideas that fit the direction: an idle screensaver with clock and ambient colour,
for apps without banners, a settings screen to edit the dock from the TV, localisation.
Ideas that don't: recommendation rows, content feeds, ads, telemetry.
+A new theme goes in `themes/<name>/` with its `config.json` and a required `screenshot.jpg` of Home on a
+real TV with that theme; see [Adding a theme](themes/README.md#adding-a-theme).
+
## 3. Improve the prompt and tools
`PROMPT.md` is what most people will actually use. If your assistant got stuck somewhere, the fix
diff --git a/README.md b/README.md
index c44fe50c9..cf25adcfe 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ phoning home, no apps you never asked for.
| *Top shelf and ambient glow* | *Inputs: HDMI with connection state, AV, Live TV* |
| ![The grid with the glass highlight on a tile and its name beneath](docs/focus-1-fancode.png) | ![The Clock screensaver: a thin clock drifting over the glow](docs/clock-screensaver.png) |
| *The grid, one glass highlight, the tile's name* | *Clock screensaver, drifts so nothing burns in* |
-| ![The aurora theme: a wallpaper and tinted pills, pushed without a rebuild](docs/theme-aurora.jpg) | ![Six columns and a six-app dock from a theme's config.json](docs/theme-six-columns.jpg) |
+| ![The aurora theme: a wallpaper and tinted pills, pushed without a rebuild](themes/aurora/screenshot.jpg) | ![Six columns and a six-app dock from a theme's config.json](themes/six-columns/screenshot.jpg) |
| *Aurora theme, pushed with `tools/theme.sh`* | *Six columns and a six-app dock, same launcher* |
## Supported TVs
diff --git a/tests/test_themes.py b/tests/test_themes.py
new file mode 100644
index 000000000..f3d50d68f
--- /dev/null
+++ b/tests/test_themes.py
@@ -0,0 +1,69 @@
+"""Checks every theme in themes/: a config.json that parses, a screenshot and a row in its README.
+
+Run from the repository root: python3 -m unittest discover -s tests -v
+"""
+import json
+import struct
+from pathlib import Path
+import unittest
+
+
+ROOT = Path(__file__).resolve().parents[1]
+THEMES = ROOT / "themes"
+MAX_SCREENSHOT = 300 * 1024
+
+
+def folders():
+ return sorted(p for p in THEMES.iterdir() if p.is_dir())
+
+
+def jpeg_size(data):
+ """(width, height) from the first SOF marker, or None if this is not a JPEG."""
+ if data[:2] != b"\xff\xd8":
+ return None
+ i = 2
+ while i + 4 <= len(data):
+ if data[i] != 0xFF:
+ return None
+ marker = data[i + 1]
+ length = struct.unpack(">H", data[i + 2:i + 4])[0]
+ if 0xC0 <= marker <= 0xCF and marker not in (0xC4, 0xC8, 0xCC):
+ height, width = struct.unpack(">HH", data[i + 5:i + 9])
+ return width, height
+ i += 2 + length
+ return None
+
+
+class ThemesTest(unittest.TestCase):
+ def test_every_theme_has_a_config(self):
+ for folder in folders():
+ with self.subTest(theme=folder.name):
+ config = folder / "config.json"
+ self.assertTrue(config.is_file(), "no config.json")
+ self.assertIsInstance(json.loads(config.read_text(encoding="utf-8")), dict)
+
+ def test_every_theme_has_a_screenshot(self):
+ for folder in folders():
+ with self.subTest(theme=folder.name):
+ shot = folder / "screenshot.jpg"
+ self.assertTrue(shot.is_file(),
+ "no screenshot.jpg: add one of Home on a real TV with this theme, see themes/README.md")
+ data = shot.read_bytes()
+ self.assertLessEqual(len(data), MAX_SCREENSHOT, "screenshot.jpg is over 300 KB")
+ size = jpeg_size(data)
+ self.assertIsNotNone(size, "screenshot.jpg is not a JPEG")
+ width, height = size
+ self.assertEqual(width * 9, height * 16, f"screenshot.jpg is {width}x{height}, not 16:9")
+ self.assertLessEqual(width, 1920, "screenshot.jpg is wider than 1920; 1280x720 is enough")
+
+ def test_readme_lists_every_theme_with_its_screenshot(self):
+ readme = (THEMES / "README.md").read_text(encoding="utf-8")
+ for folder in folders():
+ with self.subTest(theme=folder.name):
+ row = next((l for l in readme.split("\n") if l.startswith(f"| `{folder.name}/` |")), None)
+ self.assertIsNotNone(row, "no row in themes/README.md")
+ self.assertIn(f"{folder.name}/screenshot.jpg", row, "the README row does not show the screenshot")
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/themes/README.md b/themes/README.md
index e9ae32cfe..3c66c211c 100644
--- a/themes/README.md
+++ b/themes/README.md
@@ -12,13 +12,16 @@ TV_HOST=192.168.1.50 tools/theme.sh --reset # back to the built-i
powershell -ExecutionPolicy Bypass -File tools\theme.ps1 -TvHost 192.168.1.50 themes\aurora
```
-| Theme | What it does |
-|---|---|
-| `default/` | The built-in look written out as JSON, as a starting point for your own |
-| `aurora/` | A dark aurora wallpaper (teal and violet on navy, darker at the bottom) with a matching background colour |
-| `dussehra/` | Festive skin for Dussehra (ends 21 Oct 2026): a marigold toran, a faint gold rangoli, a diya for Wi-Fi, a bell for Inputs, a marigold for Settings and a petal shower |
-| `scenes/` | 14 dark illustrated landscapes in `wallpapers/`, a new one every hour; drawn from code by `tools/scenes_wallpapers.py` |
-| `six-columns/` | Six smaller tiles per row and one grid row visible under the dock |
+| 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"> |
+| `aurora/` | A dark aurora wallpaper (teal and violet on navy, darker at the bottom) with a matching background colour | <img src="aurora/screenshot.jpg" width="320" alt="aurora theme"> |
+| `dussehra/` | Festive skin for Dussehra (ends 21 Oct 2026): a marigold toran, a faint gold rangoli, a diya for Wi-Fi, a bell for Inputs, a marigold for Settings and a petal shower | <img src="dussehra/screenshot.jpg" width="320" alt="dussehra theme"> |
+| `scenes/` | 14 dark illustrated landscapes in `wallpapers/`, a new one every hour; drawn from code by `tools/scenes_wallpapers.py` | <img src="scenes/screenshot.jpg" width="320" alt="scenes theme"> |
+| `six-columns/` | Six smaller tiles per row and one grid row visible under the dock | <img src="six-columns/screenshot.jpg" width="320" alt="six-columns theme"> |
+
+Every theme folder has a `screenshot.jpg` of Home with that theme on a real TV. `tools/theme.sh` never
+pushes it; it is only here so you can see a theme before you try it.
## Keys
@@ -139,6 +142,16 @@ the plain background; the default is off (the reference launcher looks exactly a
## Adding a theme
-Open a PR with a new folder here, a one-line row in the table above and a screenshot from a real TV
-in the PR description. Keep the dock list generic (the big streaming apps) unless the theme is for a
-specific TV, and say which TV you tried it on.
+Open a PR with a new folder here containing:
+
+- `config.json`, the theme itself.
+- `screenshot.jpg`, **required**: Home on a real TV with the theme pushed, not a mock-up or an
+ emulator. Take it with `tools/tv.py 'screencap -p /sdcard/s.png'` and
+ `tools/tv.py --pull /sdcard/s.png s.png`, then save it as a JPEG at 1280×720 (16:9) under 300 KB,
+ for example `sips -z 720 1280 -s format jpeg s.png --out screenshot.jpg` on macOS. Leave the focus on
+ the dock so the glow and the hero name show. A PR without it fails CI (`tests/test_themes.py`).
+- `wallpaper.jpg` or `wallpapers/` if the theme uses them.
+
+Then add a row to the table above with the screenshot, the same way as the others. Keep the dock list
+generic (the big streaming apps) unless the theme is for a specific TV, and say which TV you tried it on
+in the PR description.
diff --git a/docs/theme-aurora.jpg b/themes/aurora/screenshot.jpg
similarity index 100%
rename from docs/theme-aurora.jpg
rename to themes/aurora/screenshot.jpg
diff --git a/themes/default/screenshot.jpg b/themes/default/screenshot.jpg
new file mode 100644
index 000000000..299f78bd6
Binary files /dev/null and b/themes/default/screenshot.jpg differ
diff --git a/docs/theme-dussehra.jpg b/themes/dussehra/screenshot.jpg
similarity index 100%
rename from docs/theme-dussehra.jpg
rename to themes/dussehra/screenshot.jpg
diff --git a/themes/scenes/screenshot.jpg b/themes/scenes/screenshot.jpg
new file mode 100644
index 000000000..c653a5d58
Binary files /dev/null and b/themes/scenes/screenshot.jpg differ
diff --git a/docs/theme-six-columns.jpg b/themes/six-columns/screenshot.jpg
similarity index 100%
rename from docs/theme-six-columns.jpg
rename to themes/six-columns/screenshot.jpg