Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
Screenshots required for add-ons and switches, as for themes
מקס חיים9bf7adf66bf5
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.mdindex 1384e2e8a..644389db8 100644--- a/.github/pull_request_template.md+++ b/.github/pull_request_template.md@@ -18,3 +18,9 @@### 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++### If this adds a theme key (a switch)+- [ ] A screenshot of the key on a real TV and its row in `docs/switches.md`++### If this adds an add-on+- [ ] `addons/<name>/screenshot.jpg`: the add-on on a real TV, 16:9 JPEG under 300 KB, shown in its row in `addons/README.md`diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 396c43f54..62e120191 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -10,9 +10,9 @@ The launcher stays small on purpose, so pick the smallest home that fits:| Your idea | Where it goes ||---|---|-| A TV model, a fix, a translation, a small switch that is off by default | A pull request here (sections 1 to 3 below) |+| A TV model, a fix, a translation, a small switch that is off by default | A pull request here (sections 1 to 3 below); a new switch with a screenshot in [`docs/switches.md`](docs/switches.md) || A new look: colours, wallpaper, dock, columns | [`themes/`](themes/README.md), with a screenshot from a real TV |-| A widget or tile that can be its own small app | [`addons/`](addons/README.md), as a module card; it never touches `launcher/` |+| A widget or tile that can be its own small app | [`addons/`](addons/README.md), as a module card with a screenshot from a real TV; it never touches `launcher/` || A whole new launcher, a heavy restyle, a port to another platform | Your own repo, plus one row in [`SHOWCASE.md`](SHOWCASE.md) (section 4) |Everything merged into `themes/` and `addons/` shows up on [cleanyour.tv/addons](https://cleanyour.tv/addons).diff --git a/addons/README.md b/addons/README.mdindex 7136a318a..27f229538 100644--- a/addons/README.md+++ b/addons/README.md@@ -7,14 +7,14 @@ the core bigger or change how it behaves. You install an add-on only if you want## Add-ons-| Add-on | What it does | Author | Tested on | Permissions |-|---|---|---|---|---|-| [Frigate Glance](frigate-glance/) | Frigate camera pop-ups over whatever is playing | NickLD | TCL 65Q650G | overlay, accessibility (card keys), network, foreground service |-| [Capacity Stats](capacity-stats/) | Available/total and used/total RAM; available/total storage | [lionlev21](https://github.com/lionlev21) | Android TV 12 (model private) | None |-| [Weather](weather/) | The weather for one city: now, US air quality and the next three days, from Open-Meteo (no key) | [@Sumyabazar1](https://github.com/Sumyabazar1) | Hisense SmartTV 4K FFM (lushan), Google TV 12 | `INTERNET` |-| [Photo Prints](photo-prints/) | Your own photos as a screensaver: dated prints dealt in on a time-of-day sky, and a card that starts the slideshow | [@shivamsingh262](https://github.com/shivamsingh262) | Sony BRAVIA KD-65X82L (Google TV 12) | None |-| [Photo screensaver](photo-screensaver/) | Your own pictures and MP4 clips as the TV's screensaver and as a card, slowly zooming and crossfading (20 s each by default); optional time, photo dates, prints on a sky and weather | [JorickGU](https://github.com/JorickGU) | TCL 43P69K (Google TV 12) | `INTERNET` and coarse location, only with the weather option on |-| [Prayer Times](prayer-times/) | Today's prayer times for one city from Aladhan (no key), the next prayer with a countdown, Gregorian and Hijri dates | [@majnioui](https://github.com/majnioui) | Xiaomi TV (MiTV-MOOR2), Google TV 11 | `INTERNET` |+| Add-on | What it does | Author | Tested on | Permissions | Screenshot |+|---|---|---|---|---|---|+| [Frigate Glance](frigate-glance/) | Frigate camera pop-ups over whatever is playing | NickLD | TCL 65Q650G | overlay, accessibility (card keys), network, foreground service | wanted |+| [Capacity Stats](capacity-stats/) | Available/total and used/total RAM; available/total storage | [lionlev21](https://github.com/lionlev21) | Android TV 12 (model private) | None | wanted |+| [Weather](weather/) | The weather for one city: now, US air quality and the next three days, from Open-Meteo (no key) | [@Sumyabazar1](https://github.com/Sumyabazar1) | Hisense SmartTV 4K FFM (lushan), Google TV 12 | `INTERNET` | <img src="weather/screenshot.jpg" width="240" alt="Weather on a TV"> |+| [Photo Prints](photo-prints/) | Your own photos as a screensaver: dated prints dealt in on a time-of-day sky, and a card that starts the slideshow | [@shivamsingh262](https://github.com/shivamsingh262) | Sony BRAVIA KD-65X82L (Google TV 12) | None | wanted |+| [Photo screensaver](photo-screensaver/) | Your own pictures and MP4 clips as the TV's screensaver and as a card, slowly zooming and crossfading (20 s each by default); optional time, photo dates, prints on a sky and weather | [JorickGU](https://github.com/JorickGU) | TCL 43P69K (Google TV 12) | `INTERNET` and coarse location, only with the weather option on | wanted |+| [Prayer Times](prayer-times/) | Today's prayer times for one city from Aladhan (no key), the next prayer with a countdown, Gregorian and Hijri dates | [@majnioui](https://github.com/majnioui) | Xiaomi TV (MiTV-MOOR2), Google TV 11 | `INTERNET` | <img src="prayer-times/screenshot.jpg" width="240" alt="Prayer Times on a TV"> |A widget, an info tile, a storage or smart-home card: if it can live as its own small app, it can livehere. See the rules below.@@ -47,6 +47,13 @@ TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py 'pm install -r /data/local/any network access or background service. The rules in [`docs/modules.md`](../docs/modules.md)apply: no telemetry without an opt-in, no ads, your own art.- **Tested on a real TV.** Say which one in the README and in the table above.+- **A screenshot.** `addons/<name>/screenshot.jpg`: the add-on on a real TV, its card in the grid or+ its own screen, as a JPEG, 16:9 (1280×720 is plenty) and under 300 KB, shown in the table's+ Screenshot column. It is what people see first here and on [cleanyour.tv/addons](https://cleanyour.tv/addons).+ Take it with `tools/tv.py --screenshot shot.png` (or `adb exec-out screencap -p > shot.png`), then+ `sips -s format jpeg -s formatOptions 85 -z 720 1280 shot.png --out screenshot.jpg` on a Mac.+ Blur anything personal: Wi-Fi names, people, addresses. Add-ons marked "wanted" in the table came+ before this rule; a screenshot for one of them is welcome.- **The author maintains it.** Issues about an add-on are assigned to its author. An add-on thatbreaks on current Android TV versions, or goes unmaintained, may be removed. Its history stays ingit, and you can keep it going in a fork listed in [`SHOWCASE.md`](../SHOWCASE.md).@@ -56,4 +63,4 @@ TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py 'pm install -r /data/local/Open a pull request that adds `addons/<name>/` and one row to the table above. The core CI is notblocked by add-ons: a separate workflow builds whatever changed under `addons/`, and`tests/test_addons.py` checks the folder rules (own Gradle project, a README with a Permissions-section, no APKs, a row in this table) and that the launcher never includes or references this folder.+section, a screenshot, no APKs, a row in this table showing the screenshot) and that the launcher never includes or references this folder.diff --git a/addons/prayer-times/screenshot.jpg b/addons/prayer-times/screenshot.jpgnew file mode 100644index 000000000..700440279Binary files /dev/null and b/addons/prayer-times/screenshot.jpg differdiff --git a/addons/weather/screenshot.jpg b/addons/weather/screenshot.jpgnew file mode 100644index 000000000..5c44fe166Binary files /dev/null and b/addons/weather/screenshot.jpg differdiff --git a/docs/switches.md b/docs/switches.mdnew file mode 100644index 000000000..00fa1bf27--- /dev/null+++ b/docs/switches.md@@ -0,0 +1,30 @@+# Switches on a TV++Every key a theme can set (the Keys table in [`themes/README.md`](../themes/README.md)) gets a+screenshot of what it does on a real TV. This table is where they are listed: the repo and+[cleanyour.tv/addons#switches](https://cleanyour.tv/addons#switches) both show them from here.++## Adding a key++A new key needs a screenshot. Put it in `docs/switches/<key>.jpg` (an existing screenshot in the+repo that shows the key at work also counts) and add a row below:++- From a real TV, with the key set, as a JPEG or PNG, 16:9 (1280×720 is plenty), under 300 KB.+- Show where the key changes something you can see. For a key that maps a remote button, show the+ screen the button opens; for one that changes behaviour only, show the setting's effect, such as+ the panel, the menu or the app that comes up.+- Blur anything personal: Wi-Fi names, people, addresses.++`tests/test_switches.py` checks that every key has a row here with an image that exists and fits+the rules. Keys from before this rule are on its wanted list; a screenshot for one of them is welcome.++## Screenshots++| Key | Screenshot |+|---|---|+| `columns` | <img src="../themes/six-columns/screenshot.jpg" width="320" alt="columns on a TV"> |+| `sky_intensity` | <img src="sky-sunset.jpg" width="320" alt="sky_intensity on a TV"> |+| `wallpaper_rotation_minutes` | <img src="../themes/scenes/screenshot.jpg" width="320" alt="wallpaper_rotation_minutes on a TV"> |+| `festival` | <img src="../themes/dussehra/screenshot.jpg" width="320" alt="festival on a TV"> |+| `settings_key_panel` | <img src="quick-settings-panel.jpg" width="320" alt="settings_key_panel on a TV"> |+| `home_idle_clock_minutes` | <img src="clock-screensaver.png" width="320" alt="home_idle_clock_minutes on a TV"> |diff --git a/tests/test_addons.py b/tests/test_addons.pyindex 151bf3eb4..a4451c65a 100644--- a/tests/test_addons.py+++ b/tests/test_addons.py@@ -1,15 +1,24 @@"""addons/ stays separate from the launcher: the core build never includes it, launcher/ never refers to it,and every add-on folder follows the rules in addons/README.md."""import re+import sysimport unittestfrom pathlib import Path+sys.path.insert(0, str(Path(__file__).resolve().parent))+from test_themes import MAX_SCREENSHOT, jpeg_size # noqa: E402+ROOT = Path(__file__).resolve().parent.parentADDONS = ROOT / "addons"LAUNCHER = ROOT / "launcher"TEXT = {".gradle", ".kts", ".java", ".kt", ".xml", ".properties", ".sh", ".ps1", ".pro", ".md"}+# Add-ons merged before screenshots were required. This list only shrinks: once one gets a+# screenshot.jpg, take it off here.+SCREENSHOT_WANTED = {"capacity-stats", "frigate-glance", "photo-prints", "photo-screensaver"}++def addon_dirs():return sorted(p for p in ADDONS.iterdir() if p.is_dir()) if ADDONS.is_dir() else []@@ -49,6 +58,30 @@ class AddonFolderTest(unittest.TestCase):"the README lists its permissions under a Permissions heading")self.assertIn(f"]({folder.name}/)", index, "addons/README.md needs a row linking this add-on")+ def test_every_addon_has_a_screenshot(self):+ index = (ADDONS / "README.md").read_text(encoding="utf-8") if ADDONS.is_dir() else ""+ for folder in addon_dirs():+ with self.subTest(addon=folder.name):+ shot = folder / "screenshot.jpg"+ if folder.name in SCREENSHOT_WANTED:+ self.assertFalse(shot.is_file(), "it has a screenshot now: take it off SCREENSHOT_WANTED")+ continue+ self.assertTrue(shot.is_file(),+ "no screenshot.jpg: add one of the add-on on a real TV, see addons/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")+ row = next((l for l in index.split("\n") if f"]({folder.name}/)" in l), "")+ self.assertIn(f"{folder.name}/screenshot.jpg", row, "the addons/README.md row does not show the screenshot")++ def test_wanted_list_names_real_addons(self):+ names = {p.name for p in addon_dirs()}+ self.assertEqual(SCREENSHOT_WANTED - names, set(), "SCREENSHOT_WANTED names a folder that is gone")+if __name__ == "__main__":unittest.main()diff --git a/tests/test_switches.py b/tests/test_switches.pynew file mode 100644index 000000000..9cc664412--- /dev/null+++ b/tests/test_switches.py@@ -0,0 +1,100 @@+"""Every theme key (a switch) has a screenshot of it on a real TV, listed in docs/switches.md.++The site's Switches tab reads the same table, so a key added with its screenshot shows up there too.+Run from the repository root: python3 -m unittest discover -s tests -v+"""+import re+import struct+import sys+import unittest+from pathlib import Path++sys.path.insert(0, str(Path(__file__).resolve().parent))+from test_themes import MAX_SCREENSHOT, jpeg_size # noqa: E402++ROOT = Path(__file__).resolve().parents[1]+DOCS = ROOT / "docs"+THEMES_README = ROOT / "themes" / "README.md"+SWITCHES = DOCS / "switches.md"++# Keys from before screenshots were required. This list only shrinks: once a key has a row in+# docs/switches.md, take it off here.+SCREENSHOT_WANTED = {+ "accent_color", "advanced_effects", "always_show_names", "ambient_glow", "animations",+ "app_banners", "app_glow", "app_keys", "app_labels", "app_library", "background_color",+ "boot_to_live_tv", "cinematic_home", "coocaa_sources", "dock_apps", "dock_even_padding",+ "dock_glass", "dock_opacity", "dock_row", "dock_title", "festival_until", "fill_dock",+ "focus_overshoot", "glow_style", "greeting", "greeting_name", "handle_view_inputs", "hidden_apps",+ "icon_only_buttons", "icon_only_inputs", "input_action", "input_key_keycodes", "input_sources",+ "input_uri_scheme", "key_filter", "launch_actions", "launcher_settings_button", "library_apps",+ "library_button", "live_tv_action", "live_tv_input_id", "live_tv_package", "module_cards",+ "race_calendar", "reduced_motion", "reorder_button", "restore_key_services", "rows_below_dock",+ "settings_key_keycodes", "shamsi_date", "show_home_settings_shortcut", "show_inputs_pill",+ "show_network_pill", "show_stats", "source_panel_action", "source_panel_extra",+ "source_panel_service", "stock_home_redirect", "tile_menu", "top_menu", "vpn_app", "wallpaper",+ "wallpaper_captions", "wallpaper_dim", "wallpaper_order", "wallpaper_true_color",+ "wifi_label_width",+}+++def theme_keys():+ """Every key in the Keys table of themes/README.md, as the site reads it."""+ keys, on = [], False+ for line in THEMES_README.read_text(encoding="utf-8").split("\n"):+ if re.match(r"^##\s", line):+ on = bool(re.match(r"^##\s+Keys\s*$", line))+ if not on or not re.match(r"^\|\s*`[a-z_]+`", line):+ continue+ for key in re.findall(r"`([a-z_]+)`", line.split("|")[1]):+ if key not in keys:+ keys.append(key)+ return keys+++def screenshot_rows():+ """key -> image path relative to docs/, from the Screenshots table of docs/switches.md."""+ rows = {}+ for line in SWITCHES.read_text(encoding="utf-8").split("\n"):+ m = re.match(r'^\|\s*`([a-z_]+)`\s*\|.*<img[^>]*\bsrc="([^"]+)"', line)+ if m:+ rows[m.group(1)] = m.group(2)+ return rows+++def png_size(data):+ if data[:8] != b"\x89PNG\r\n\x1a\n" or data[12:16] != b"IHDR":+ return None+ return struct.unpack(">II", data[16:24])+++class SwitchScreenshotTest(unittest.TestCase):+ def test_every_key_has_a_screenshot(self):+ rows = screenshot_rows()+ for key in theme_keys():+ with self.subTest(key=key):+ if key in SCREENSHOT_WANTED:+ self.assertNotIn(key, rows, "it has a screenshot now: take it off SCREENSHOT_WANTED")+ continue+ self.assertIn(key, rows, "no screenshot: add one to docs/switches.md (see its Adding a key section)")++ def test_screenshots_exist_and_fit_the_rules(self):+ for key, src in screenshot_rows().items():+ with self.subTest(key=key):+ path = (DOCS / src).resolve()+ self.assertTrue(path.is_file(), f"{src} does not exist")+ data = path.read_bytes()+ self.assertLessEqual(len(data), MAX_SCREENSHOT, f"{src} is over 300 KB")+ size = jpeg_size(data) or png_size(data)+ self.assertIsNotNone(size, f"{src} is not a JPEG or PNG")+ width, height = size+ self.assertEqual(width * 9, height * 16, f"{src} is {width}x{height}, not 16:9")+ self.assertLessEqual(width, 1920, f"{src} is wider than 1920; 1280x720 is enough")++ def test_rows_and_wanted_list_name_real_keys(self):+ keys = set(theme_keys())+ self.assertEqual(set(screenshot_rows()) - keys, set(), "docs/switches.md lists a key themes/README.md does not")+ self.assertEqual(SCREENSHOT_WANTED - keys, set(), "SCREENSHOT_WANTED names a key themes/README.md does not")+++if __name__ == "__main__":+ unittest.main()diff --git a/themes/README.md b/themes/README.mdindex c0b455181..40cf64c53 100644--- a/themes/README.md+++ b/themes/README.md@@ -29,6 +29,9 @@ pushes it; it is only here so you can see a theme before you try it.Every key is optional; a missing key keeps the value from `config.xml`, an unknown or wrongly typed keyis ignored, and a file that doesn't parse is ignored as a whole, so a theme can never break Home.+Each key has (or is waiting for) a screenshot of it on a real TV in [`docs/switches.md`](../docs/switches.md).+A new key needs one there in the same pull request.+| Key | Type | Meaning ||---|---|---|| `dock_apps` | list of package names | The dock row, in order; missing apps are skipped |