Skip to content

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

README: stat strip as an image in the banner's style, drop the link row, 简体中文 as a badge

Gathin23717d8aea0c2e
diff --git a/README.md b/README.md
index 2c0aa1ef7..cafaf6d00 100644
--- a/README.md
+++ b/README.md
@@ -7,27 +7,13 @@
<a href="https://github.com/Gathin23/cleanyourtv/pulls?q=is%3Amerged"><img src="https://img.shields.io/github/issues-pr-closed/Gathin23/cleanyourtv?style=flat&cacheSeconds=1800&label=merged%20PRs&color=cfffcf&labelColor=15181e" alt="Merged PRs"></a>
<a href="https://github.com/Gathin23/cleanyourtv/network/members"><img src="https://img.shields.io/github/forks/Gathin23/cleanyourtv?style=flat&cacheSeconds=1800&color=cfffcf&labelColor=15181e" alt="Forks"></a>
<a href="https://github.com/Gathin23/cleanyourtv/graphs/contributors"><img src="https://img.shields.io/github/contributors/Gathin23/cleanyourtv?style=flat&cacheSeconds=1800&color=cfffcf&labelColor=15181e" alt="Contributors"></a>
- <a href="LICENSE"><img src="https://img.shields.io/badge/licence-MIT-cfffcf?style=flat&labelColor=15181e" alt="MIT"></a>
+ <a href="README.zh-CN.md"><img src="https://img.shields.io/badge/README-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-cfffcf?style=flat&labelColor=15181e" alt="简体中文"></a>
<a href="https://buymeacoffee.com/gathint"><img src="https://img.shields.io/badge/support-%E2%9D%A4-ff5e8a?style=flat&labelColor=15181e" alt="Support, buy me a coffee"></a>
<a href="https://www.producthunt.com/products/cleanyourtv"><img src="https://img.shields.io/badge/Product%20Hunt-launching%20Oct%2021-da552f?style=flat&logo=producthunt&logoColor=white&labelColor=15181e" alt="CleanYourTV on Product Hunt"></a>
</p>
-<div align="center">
-<table>
- <tr>
- <td align="center"><h3>123</h3><sub>TV MODELS</sub></td>
- <td align="center"><h3>42</h3><sub>BRANDS</sub></td>
- <td align="center"><h3>19</h3><sub>LANGUAGES</sub></td>
- <td align="center"><h3>390 KB</h3><sub>LAUNCHER</sub></td>
- </tr>
-</table>
-</div>
-
<p align="center">
- <a href="https://cleanyour.tv">cleanyour.tv</a> ·
- <a href="PROMPT.md">The prompt</a> ·
- <a href="SHOWCASE.md">Showcase</a> ·
- <a href="README.zh-CN.md">简体中文</a>
+ <img src="docs/stats.png" alt="123 TV models · 42 brands · 19 languages · 390 KB launcher" width="800">
</p>
Strip the bloatware from any Android TV or Google TV over Wi-Fi, and replace the ad-filled home
diff --git a/docs/stats.png b/docs/stats.png
new file mode 100644
index 000000000..5f8031798
Binary files /dev/null and b/docs/stats.png differ
diff --git a/tests/test_examples.py b/tests/test_examples.py
index 8b21fcd02..f523c7dda 100644
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -80,7 +80,7 @@ class ExampleListsTest(unittest.TestCase):
def test_readme_counts(self):
text = (ROOT / "README.md").read_text(encoding="utf-8")
n = len(folders())
- self.assertIn(f"<h3>{n}</h3><sub>TV MODELS</sub>", text, "stat strip count is stale")
+ self.assertIn(f"{n} TV models", text, "stat strip alt text is stale (regenerate docs/stats.png too)")
if __name__ == "__main__":
diff --git a/tools/readme_stats.py b/tools/readme_stats.py
new file mode 100644
index 000000000..a26fa13cf
--- /dev/null
+++ b/tools/readme_stats.py
@@ -0,0 +1,21 @@
+"""Renders the README stat strip (docs/stats.png) in the banner's style.
+
+Update STATS (and the README alt text), then: python3 tools/readme_stats.py Fredoka.ttf docs/stats.png
+Fredoka is the variable TTF from Google Fonts."""
+import sys
+from PIL import Image, ImageDraw, ImageFont
+FONT, OUT = sys.argv[1], sys.argv[2]
+STATS = [("123", "TV MODELS"), ("42", "BRANDS"), ("19", "LANGUAGES"), ("390 KB", "LAUNCHER")]
+W, H = 1600, 240
+img = Image.new("RGB", (W, H), "#15181e"); d = ImageDraw.Draw(img)
+def f(size, wt):
+ x = ImageFont.truetype(FONT, size); x.set_variation_by_axes([wt]); return x
+num, lab = f(92, 600), f(30, 500)
+col = W / len(STATS)
+for i, (n, l) in enumerate(STATS):
+ cx = col * i + col / 2
+ w = d.textlength(n, font=num); d.text((cx - w / 2, 40), n, font=num, fill="#cfffcf")
+ sp = 5; w = sum(d.textlength(c, font=lab) for c in l) + sp * (len(l) - 1); x = cx - w / 2
+ for c in l: d.text((x, 160), c, font=lab, fill="#aab3bd"); x += d.textlength(c, font=lab) + sp
+ if i: d.line([(col * i, 56), (col * i, H - 56)], fill="#2c313a", width=3)
+img.save(OUT, optimize=True)