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
themes: add diwali, eight Diwali photos from Wikimedia Commons with the Diwali skin until 11 Nov 2026
Gathin23d451b175ab3f
diff --git a/README.de.md b/README.de.mdindex ffc897354..02da93920 100644--- a/README.de.md+++ b/README.de.md@@ -259,7 +259,7 @@ Gerät übrig bleibt, steht in der [Fehlerbehebung](docs/TROUBLESHOOTING.md).|---|---|| **Einrichten** | Dock-Reihenfolge, versteckte Apps, Live-TV-App, 4 bis 7 Kacheln je Zeile, reduzierte Bewegung. Alles in [`config.xml`](launcher/app/src/main/res/values/config.xml) || **Einstellungen am Fernseher** | OK auf Einstellungen halten für die Launcher-Einstellungen. Ein optionales `launcher_settings_button` lässt einen normalen Klick sie direkt öffnen; die TV-Einstellungen bleiben auf der Einstellungsseite und ihrer App-Kachel. |-| **Themes** | Hintergrund, Wallpaper und Layout aus einer `config.json`, über WLAN aufgespielt, ohne neuen Build. Siebenundzwanzig liegen in [`themes/`](themes/), das eingebaute `default/` mitgerechnet |+| **Themes** | Hintergrund, Wallpaper und Layout aus einer `config.json`, über WLAN aufgespielt, ohne neuen Build. Achtundzwanzig liegen in [`themes/`](themes/), das eingebaute `default/` mitgerechnet || **31 Sprachen** | Folgt der Sprache des Fernsehers, mit vollständig gespiegeltem Layout von rechts nach links für Hebräisch || **App-Bibliothek** | Optional: jede installierte App durchsehen und Home-Verknüpfungen hinzufügen oder entfernen. Siehe [die Anleitung zur App-Bibliothek](docs/app-library.md) || **Kachelmenü** | Standardmäßig an (`tile_menu`): OK auf einer Kachel halten für Verschieben und App-Info, mit eingeschalteter App-Bibliothek auch Von Home entfernen. Aus: OK halten öffnet App-Info |diff --git a/README.he.md b/README.he.mdindex 48ff85584..b54bd412a 100644--- a/README.he.md+++ b/README.he.md@@ -237,7 +237,7 @@ TV_HOST=192.168.1.50 tools/venv/bin/python -I tools/privacy.py|---:|---:|| **התאמה אישית** | סדר המועדפים, אפליקציות מוסתרות, אפליקציית שידור חי, 4 עד 7 אריחים בשורה והפחתת תנועה. ההגדרות נמצאות ב־[config.xml](launcher/app/src/main/res/values/config.xml). || **הגדרות בטלוויזיה** | לחיצה ארוכה על OK בכפתור ההגדרות פותחת את הגדרות מסך הבית. עם <code dir="ltr">launcher_settings_button</code> מספיקה לחיצה רגילה. הגדרות הטלוויזיה זמינות גם מדף ההגדרות ומאריח האפליקציה. |-| **ערכות עיצוב** | רקע, תמונה ופריסה מקובץ <code dir="ltr">config.json</code> שנשלח דרך הרשת. יש 27 ערכות ב־[themes](themes/), כולל ברירת המחדל. |+| **ערכות עיצוב** | רקע, תמונה ופריסה מקובץ <code dir="ltr">config.json</code> שנשלח דרך הרשת. יש 28 ערכות ב־[themes](themes/), כולל ברירת המחדל. || **31 שפות** | השפה נקבעת לפי הטלוויזיה. בעברית הפריסה מוצגת מימין לשמאל. || **ספריית אפליקציות** | אפשר לדפדף בכל האפליקציות המותקנות ולהוסיף או להסיר קיצורי דרך ממסך הבית. [מדריך](docs/app-library.md) || **תפריט אריח** | <code dir="ltr">tile_menu</code> מופעל כברירת מחדל. לחיצה ארוכה על OK מאפשרת להזיז אריח ולפתוח פרטי אפליקציה. כשספריית האפליקציות מופעלת אפשר גם להסיר את האריח מהבית. כשהתפריט כבוי, לחיצה ארוכה פותחת את פרטי האפליקציה. |diff --git a/README.md b/README.mdindex 2fcacfa72..8dc4981f1 100644--- a/README.md+++ b/README.md@@ -284,7 +284,7 @@ set is in [Troubleshooting](docs/TROUBLESHOOTING.md).|---|---|| **Configure** | Dock order, hidden apps, Live TV app, 4 to 7 tiles per row, reduced motion. All in [`config.xml`](launcher/app/src/main/res/values/config.xml) || **Settings on the TV** | Hold OK on Settings for launcher settings. Optional `launcher_settings_button` makes a normal click open them directly; TV settings remain on the settings page and their app tile. |-| **Themes** | Background, wallpaper and layout from a `config.json` pushed over Wi-Fi, no rebuild. Twenty-seven ship in [`themes/`](themes/), the built-in `default/` included |+| **Themes** | Background, wallpaper and layout from a `config.json` pushed over Wi-Fi, no rebuild. Twenty-eight ship in [`themes/`](themes/), the built-in `default/` included || **31 languages** | Follows the TV's language, with a fully mirrored right-to-left layout for Hebrew || **App library** | Optional: browse every installed app and add or remove Home shortcuts. See [the app library guide](docs/app-library.md) || **Tile menu** | On by default (`tile_menu`): hold OK on a tile for Move and App info, plus Remove from Home when the app library is on. Off, holding OK opens App info |diff --git a/README.nl.md b/README.nl.mdindex 43d417379..cd31f5015 100644--- a/README.nl.md+++ b/README.nl.md@@ -710,7 +710,7 @@ De **tv** moet Android 8.0 (API 26) of nieuwer gebruiken. `minSdk` stelt de mini|---|---|| **Configuratie** | Volgorde van het dock, verborgen apps, Live-tv-app, 4 tot 7 tegels per rij en minder beweging. Alles staat in [`config.xml`](launcher/app/src/main/res/values/config.xml). || **Instellingen op de tv** | Houd OK ingedrukt op Instellingen om de launcherinstellingen te openen. Met de optionele instelling `launcher_settings_button` opent een gewone klik ze direct; de tv-instellingen blijven beschikbaar via de instellingenpagina en de tegel van die app. |-| **Thema's** | Achtergrond, wallpaper en indeling komen uit een via wifi verzonden `config.json`; opnieuw bouwen is niet nodig. In [`themes/`](themes/) staan zevenentwintig thema's, inclusief het ingebouwde `default/`. |+| **Thema's** | Achtergrond, wallpaper en indeling komen uit een via wifi verzonden `config.json`; opnieuw bouwen is niet nodig. In [`themes/`](themes/) staan achtentwintig thema's, inclusief het ingebouwde `default/`. || **31 talen** | Volgt de taal van de tv, met een volledig gespiegeld rechts-naar-links ontwerp voor Hebreeuws. || **Appbibliotheek** | Optioneel: bekijk alle geïnstalleerde apps en voeg snelkoppelingen op het startscherm toe of verwijder ze. Zie [de handleiding voor de appbibliotheek](docs/app-library.md). || **Tegelmenu** | Standaard aan (`tile_menu`): houd OK ingedrukt op een tegel voor Verplaatsen en App-info, en met de appbibliotheek aan ook Verwijderen van startscherm. Staat dit uit, dan opent lang indrukken de app-info. |diff --git a/README.pt-BR.md b/README.pt-BR.mdindex c68f8788d..277e3fd33 100644--- a/README.pt-BR.md+++ b/README.pt-BR.md@@ -283,7 +283,7 @@ explicado em [Solução de problemas](docs/TROUBLESHOOTING.md).|---|---|| **Configuração** | Ordem do dock, aplicativos ocultos, aplicativo de TV ao vivo, de 4 a 7 blocos por linha e animações reduzidas. Tudo em [`config.xml`](launcher/app/src/main/res/values/config.xml). || **Configurações na TV** | Mantenha OK pressionado em Configurações para abrir as configurações do launcher. Opcionalmente, `launcher_settings_button` faz com que um clique normal as abra diretamente; as configurações da TV continuam disponíveis na página de configurações e no bloco do aplicativo correspondente. |-| **Temas** | Plano de fundo, papel de parede e layout definidos em um `config.json` enviado pelo Wi-Fi, sem recompilação. 27 temas estão incluídos em [`themes/`](themes/), incluindo o `default/` integrado. |+| **Temas** | Plano de fundo, papel de parede e layout definidos em um `config.json` enviado pelo Wi-Fi, sem recompilação. 28 temas estão incluídos em [`themes/`](themes/), incluindo o `default/` integrado. || **31 idiomas** | Segue o idioma da TV, com layout totalmente espelhado da direita para a esquerda em hebraico. || **Biblioteca de aplicativos** | Opcional: permite navegar por todos os aplicativos instalados e adicionar ou remover atalhos da tela inicial. Consulte [o guia da biblioteca de aplicativos](docs/app-library.md). || **Menu dos blocos** | Ativado por padrão (`tile_menu`): mantenha OK pressionado em um bloco para acessar Mover, Remover da tela inicial e Informações do app. Se estiver desativado, manter OK pressionado abre Informações do app. |diff --git a/README.tr.md b/README.tr.mdindex e91a54845..ae037f3d1 100644--- a/README.tr.md+++ b/README.tr.md@@ -281,7 +281,7 @@ bir cihazda neyin kaldığı [Sorun giderme](docs/TROUBLESHOOTING.md) belgesinde|---|---|| **Yapılandırma** | Dock sırası, gizli uygulamalar, Canlı TV uygulaması, satır başına 4 ile 7 arası kutucuk, azaltılmış hareket. Hepsi [`config.xml`](launcher/app/src/main/res/values/config.xml) içinde || **TV'deki ayarlar** | Başlatıcı ayarları için Ayarlar üzerinde OK'u basılı tutun. İsteğe bağlı `launcher_settings_button`, normal bir tıklamanın onları doğrudan açmasını sağlar; TV ayarları ayarlar sayfasında ve kendi uygulama kutucuğunda kalır. |-| **Temalar** | Wi-Fi üzerinden gönderilen bir `config.json` ile arka plan, duvar kâğıdı ve düzen, yeniden derleme yok. Yerleşik `default/` dahil 27 tema [`themes/`](themes/) içinde gelir |+| **Temalar** | Wi-Fi üzerinden gönderilen bir `config.json` ile arka plan, duvar kâğıdı ve düzen, yeniden derleme yok. Yerleşik `default/` dahil 28 tema [`themes/`](themes/) içinde gelir || **31 dil** | TV'nin diline uyar; İbranice için tamamen aynalanmış, sağdan sola bir düzen sunar || **Uygulama kitaplığı** | İsteğe bağlı: yüklü tüm uygulamalara göz atın ve Ana ekran kısayolları ekleyin veya kaldırın. Bkz. [uygulama kitaplığı kılavuzu](docs/app-library.md) || **Kutucuk menüsü** | Varsayılan olarak açık (`tile_menu`): Taşı ve Uygulama bilgisi için bir kutucukta OK'u basılı tutun; uygulama kitaplığı açıksa Ana ekrandan kaldır da çıkar. Kapalıyken OK'u basılı tutmak Uygulama bilgisini açar |diff --git a/README.uk.md b/README.uk.mdindex c6c8988ca..9d780a96d 100644--- a/README.uk.md+++ b/README.uk.md@@ -282,7 +282,7 @@ Xiaomi (PatchWall). Передайте `STOCK_LAUNCHER=<package>` (`-StockLaunch|---|---|| **Налаштування** | Порядок дока, приховані застосунки, застосунок ефірного ТБ, від 4 до 7 плиток у рядку, зменшений рух. Усе в [`config.xml`](launcher/app/src/main/res/values/config.xml) || **Налаштування на телевізорі** | Утримайте OK на «Налаштуваннях», щоб відкрити налаштування лончера. Необов'язковий `launcher_settings_button` робить так, що звичайне натискання відкриває їх одразу; налаштування телевізора лишаються на сторінці налаштувань і на своїй плитці |-| **Теми** | Тло, шпалери й розкладка з `config.json`, надісланого через Wi-Fi, без перезбирання. У [`themes/`](themes/) постачається двадцять сім, включно з вбудованою `default/` |+| **Теми** | Тло, шпалери й розкладка з `config.json`, надісланого через Wi-Fi, без перезбирання. У [`themes/`](themes/) постачається двадцять вісім, включно з вбудованою `default/` || **31 мова** | Дотримується мови телевізора, з повністю дзеркальним розкладом справа наліво для івриту || **Бібліотека застосунків** | Необов'язково: перегляд усіх встановлених застосунків і додавання чи прибирання ярликів із головного екрана. Дивіться [посібник із бібліотеки застосунків](docs/app-library.md) || **Меню плитки** | Увімкнено за замовчуванням (`tile_menu`): утримайте OK на плитці для «Перемістити» та «Про застосунок», а з увімкненою бібліотекою застосунків — ще й «Прибрати з головного». Вимкнено — утримання OK відкриває «Про застосунок» |diff --git a/themes/README.md b/themes/README.mdindex 5872ad842..e3736d7f7 100644--- a/themes/README.md+++ b/themes/README.md@@ -49,6 +49,7 @@ updated. Add-ons with custom shell installers still need Bash; this native Windo| `glass/` | Dark navy wallpaper with soft teal and violet light, the cinematic top shelf, a frosted-glass dock, icon-only buttons and the focus glow in the app's colour, gliding without overshoot | <img src="glass/screenshot.jpg" width="320" alt="glass theme"> || `glass-gallery/` | Seven slots in a translucent dock, an app library, white icon-only header controls and three original abstract wallpapers rotated every 30 minutes. No app-colour glow or advanced effects. The wallpapers are CC0: see [CREDITS.md](glass-gallery/CREDITS.md) | <img src="glass-gallery/screenshot.jpg" width="320" alt="glass-gallery theme on a Kenwood K32M15G6"> || `christmas/` | A snowy Christmas night, an illustration of our own (CC0, drawn by `make_wallpaper.py`): Santa's sleigh and reindeer over a lit cabin and fir trees, with a frosted-glass dock, faded rows and the picture behind the idle clock. No start or end date: push it on the day you want it | <img src="christmas/screenshot.jpg" width="320" alt="christmas theme"> |+| `diwali/` | Diwali until 11 Nov 2026: eight Diwali photos from Wikimedia Commons (a row of diyas, diyas in a rangoli and among marigolds, akash kandils in Pune, fireworks over Melbourne's Yarra and over a lake in Chennai, a street in lights in Karnal, a diya with four flames), a new one every 20 minutes with its photographer under the buttons (credited in `diwali/CREDITS.md`; CC BY / CC BY-SA, not MIT; rebuilt by `prepare_wallpapers.py`). The dock sits low so the picture shows, and the festive skin turns Wi-Fi into a diya, Inputs into a bell and Settings into a marigold, greets you with Happy Diwali and switches itself off after 11 November | <img src="diwali/screenshot.jpg" width="320" alt="diwali theme"> || `halloween/` | Halloween until 1 Nov 2026: an illustrated haunted house (our own, CC0) and seven night photos from Wikimedia Commons (jack-o'-lanterns by candlelight, a full moon behind a sequoia grove and over a Swedish fjord, a moonrise, two cemeteries in fog), a new one every 30 minutes (credited in `halloween/CREDITS.md`, not on screen), and a frosted-glass dock. With a launcher that knows `seasonal_skin`, the Halloween skin too: a jack-o'-lantern for Wi-Fi that glows while online, a bat for Inputs, a ghost for Settings, bats over the first Home of the day and "Happy Halloween"; it switches itself off after 1 November, the pictures stay until `--reset`. The illustration is CC0; the photos are CC0, public domain, CC BY and CC BY-SA, not MIT: see `halloween/CREDITS.md` | <img src="halloween/screenshot.jpg" width="320" alt="halloween theme"> || `istanbul/` | Istanbul drawn in flat layers by code alone: Topkapı Palace, Hagia Sophia, the Blue Mosque, Galata Tower and the Bosphorus Bridge over the water with a ferry, under a faint eight-pointed-star lattice, in a morning, evening and night picture (`wallpaper_moods`, icon-only buttons). The pictures are CC0, not MIT: see `istanbul/CREDITS.md` | <img src="istanbul/screenshot.jpg" width="320" alt="istanbul theme"> || `istanbul_v2/` | Three illustrated Istanbul skylines, from the historic peninsula to Galata Tower and the Bosphorus Bridge, in the morning, at sunset and at night (`wallpaper_moods`, a light 15% dim, icon-only buttons). The pictures are CC0, not MIT: see `istanbul_v2/CREDITS.md` | <img src="istanbul_v2/screenshot.jpg" width="320" alt="istanbul_v2 theme"> |diff --git a/themes/diwali/CREDITS.md b/themes/diwali/CREDITS.mdnew file mode 100644index 000000000..d18d3d2cc--- /dev/null+++ b/themes/diwali/CREDITS.md@@ -0,0 +1,29 @@+The eight wallpapers are photos from Wikimedia Commons, each under its own licence (CC BY or CC BY-SA), not the+repository's MIT licence. `prepare_wallpapers.py` rebuilds them from the originals listed there (it checks each+file's SHA-256). Changes made to every photo: cropped to 16:9 (the box is in the script), resized to 1920x1080,+darkened toward the bottom, the top-left corner and a little under the top-right buttons so the dock, the clock and+the buttons stay readable, and saved again as JPEG without the original's EXIF or other metadata. Adaptations of the+CC BY-SA pictures stay under CC BY-SA. Each picture's credit also shows under the buttons (`wallpaper_captions`).++- `01-row-of-diyas.jpg`: "Diwali Diyas 4.jpg" by Slyronit, CC BY-SA 4.0+ https://commons.wikimedia.org/wiki/File:Diwali_Diyas_4.jpg+- `02-rangoli-and-diyas.jpg`: "Diya set in a rangoli.jpg" by siddarth varanasi, CC BY 2.0+ https://commons.wikimedia.org/wiki/File:Diya_set_in_a_rangoli.jpg+- `03-diyas-and-marigolds.jpg`: "The Glow of Togetherness, Diwali in Common Households of India 02.jpg" by The open+ draft, CC BY-SA 4.0+ https://commons.wikimedia.org/wiki/File:The_Glow_of_Togetherness,_Diwali_in_Common_Households_of_India_02.jpg+- `04-akash-kandils.jpg`: "Diwali Lanterns in Pun Maharashtra.jpg" by आर्या जोशी (Arya Joshi), CC BY-SA 4.0+ https://commons.wikimedia.org/wiki/File:Diwali_Lanterns_in_Pun_Maharashtra.jpg+- `05-fireworks-over-the-city.jpg`: "Diwali Fireworks, Melbourne Australia 2013.jpg" by Chris Phutully, CC BY 2.0+ https://commons.wikimedia.org/wiki/File:Diwali_Fireworks,_Melbourne_Australia_2013.jpg+- `06-fireworks-over-the-lake.jpg`: "Fireworks Diwali Chennai India November 2013 b.jpg" by Sriram Jagannathan,+ CC BY 2.0+ https://commons.wikimedia.org/wiki/File:Fireworks_Diwali_Chennai_India_November_2013_b.jpg+- `07-a-street-in-lights.jpg`: "DiwaliStreetKarnal.JPG" by Arne Hückelheim, CC BY-SA 3.0+ https://commons.wikimedia.org/wiki/File:DiwaliStreetKarnal.JPG+- `08-four-flames.jpg`: "Diwali deepak (diya).jpg" by Moneysha26, CC BY-SA 4.0+ https://commons.wikimedia.org/wiki/File:Diwali_deepak_(diya).jpg++CC BY 2.0: https://creativecommons.org/licenses/by/2.0/+CC BY-SA 3.0: https://creativecommons.org/licenses/by-sa/3.0/+CC BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/diff --git a/themes/diwali/config.json b/themes/diwali/config.jsonnew file mode 100644index 000000000..5c7cb58a4--- /dev/null+++ b/themes/diwali/config.json@@ -0,0 +1,21 @@+{+ "festival": "diwali",+ "festival_until": "2026-11-11",+ "accent_color": "#FFB23C",+ "background_color": "#0A0508",+ "wallpaper": true,+ "wallpaper_rotation_minutes": 20,+ "wallpaper_order": "sequential",+ "wallpaper_captions": true,+ "wallpaper_dim": 10,+ "rows_below_dock": 0,+ "dock_title": false,+ "dock_glass": true,+ "dock_opacity": 45,+ "dock_even_padding": true,+ "ambient_glow": false,+ "fade_rows": true,+ "icon_only_buttons": true,+ "clock_wallpaper": true,+ "clock_wallpaper_dim": 30+}diff --git a/themes/diwali/prepare_wallpapers.py b/themes/diwali/prepare_wallpapers.pynew file mode 100644index 000000000..e1a2f091a--- /dev/null+++ b/themes/diwali/prepare_wallpapers.py@@ -0,0 +1,105 @@+#!/usr/bin/env python3+"""Builds wallpapers/ from eight Diwali photos on Wikimedia Commons (credited in CREDITS.md and in captions.txt).++Each original is fetched from Commons (or read from ORIGINALS if it is already there), checked against the SHA-256+below, cropped to 16:9 with the box given, resized to 1920x1080, darkened toward the bottom (the dock), the top-left+corner (the clock) and a little under the top-right buttons, and saved as a JPEG with no EXIF or other metadata.++Usage: python3 prepare_wallpapers.py ORIGINALS (needs Pillow; ORIGINALS is a folder for the downloads)+"""+import hashlib+import os+import sys+import time+import urllib.error+import urllib.request++from PIL import Image, ImageChops, ImageDraw, ImageFilter++W, H = 1920, 1080+OUT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "wallpapers")+COMMONS = "https://upload.wikimedia.org/wikipedia/commons/"++# (output name, Commons path, SHA-256 of the original, crop box (left, top, right, bottom) on the original)+SOURCES = [+ ("01-row-of-diyas.jpg", "a/a7/Diwali_Diyas_4.jpg",+ "713edcb5666a0c368f481d8c2a518bd15b6597c8a7fc8c1603cb2dcba5760d6f", (857, 987, 4857, 3237)),+ ("02-rangoli-and-diyas.jpg", "0/04/Diya_set_in_a_rangoli.jpg",+ "52bcbcefc37c9399bf8604063e255ea824cfac3d9a5a0c2971e789e10bcef895", (0, 160, 4608, 2752)),+ ("03-diyas-and-marigolds.jpg", "5/51/The_Glow_of_Togetherness%2C_Diwali_in_Common_Households_of_India_02.jpg",+ "0a2ef9c23a07a532774759ff51be8279cbeffb0d8e60c328db083602a4d8fea1", (0, 560, 4080, 2855)),+ ("04-akash-kandils.jpg", "e/e5/Diwali_Lanterns_in_Pun_Maharashtra.jpg",+ "59f4aa4f09dc9e9180d7de56113223107a706ae78ccec50c00a0ec394d09232a", (0, 0, 4080, 2295)),+ ("05-fireworks-over-the-city.jpg", "6/68/Diwali_Fireworks%2C_Melbourne_Australia_2013.jpg",+ "f6e2833aeb6fed2f9f66b4ae70f889180c4b3715c75d796ab687c2410098c5e7", (0, 100, 3580, 2114)),+ ("06-fireworks-over-the-lake.jpg", "2/2f/Fireworks_Diwali_Chennai_India_November_2013_b.jpg",+ "709ba680685f9de785b24ecc8573b377e7145558d9f17faf5fd65bb3732155e3", (0, 0, 5367, 3019)),+ ("07-a-street-in-lights.jpg", "c/c8/DiwaliStreetKarnal.JPG",+ "4f96e01b54a11ae4ed4706bdfd1281c2bcefdc161f1fdd2054cbfed238f990c0", (0, 405, 3888, 2592)),+ ("08-four-flames.jpg", "5/50/Diwali_deepak_%28diya%29.jpg",+ "39ab58f1267105042b6fe651b7356254cbbaf3d3f4b95e4277161724d2c6a97a", (0, 200, 6016, 3584)),+]+++def fetch(folder, path, sha):+ name = os.path.join(folder, os.path.basename(path).replace("%2C", ",").replace("%28", "(").replace("%29", ")"))+ if not os.path.exists(name):+ req = urllib.request.Request(COMMONS + path, headers={"User-Agent": "CleanYourTV-themes (github.com/Gathin23/cleanyourtv)"})+ for attempt in range(5): # Commons answers 429 to quick runs of downloads; wait and try again+ try:+ with urllib.request.urlopen(req, timeout=120) as r:+ data = r.read()+ break+ except urllib.error.HTTPError as e:+ if e.code != 429 or attempt == 4:+ raise+ time.sleep(10 * (attempt + 1))+ with open(name, "wb") as f:+ f.write(data)+ data = open(name, "rb").read()+ if data[:3] != b"\xff\xd8\xff":+ sys.exit(f"{name} is not a JPEG")+ if hashlib.sha256(data).hexdigest() != sha:+ sys.exit(f"{name} is not the file this theme was made from (SHA-256 differs)")+ return name+++def shade(img):+ """The same darkening as the other wallpaper themes: bottom for the dock, top-left for the clock, top-right buttons."""+ mask = Image.new("L", (W, H), 0)+ md = ImageDraw.Draw(mask)+ for y in range(H):+ t = max(0.0, (y - H * 0.55) / (H * 0.45))+ md.line([(0, y), (W, y)], fill=int(255 * 0.6 * t ** 1.3))+ corner = Image.new("L", (W, H), 0)+ ImageDraw.Draw(corner).ellipse([-520, -420, 780, 440], fill=int(255 * 0.62))+ ImageDraw.Draw(corner).ellipse([1220, 30, 2120, 340], fill=int(255 * 0.45))+ mask = ImageChops.lighter(mask, corner.filter(ImageFilter.GaussianBlur(160)))+ return Image.composite(Image.new("RGB", (W, H), (4, 2, 6)), img, mask)+++def main(folder):+ os.makedirs(folder, exist_ok=True)+ os.makedirs(OUT, exist_ok=True)+ for out, path, sha, box in SOURCES:+ x0, y0, x1, y1 = box+ if abs((x1 - x0) * 9 - (y1 - y0) * 16) > 16:+ sys.exit(f"{out}: crop box is not 16:9")+ src = Image.open(fetch(folder, path, sha))+ src.load()+ img = src.convert("RGB").crop(box).resize((W, H), Image.LANCZOS)+ # a new image with only the pixels: no EXIF, ICC or XMP from the original is carried over+ clean = Image.new("RGB", (W, H))+ clean.paste(shade(img))+ for quality in range(86, 69, -2): # the best quality that stays under 300 KB, as the theme guide asks+ dest = os.path.join(OUT, out)+ clean.save(dest, quality=quality, optimize=True, progressive=True)+ if os.path.getsize(dest) <= 300 * 1024:+ break+ print("wrote", os.path.join("wallpapers", out))+++if __name__ == "__main__":+ if len(sys.argv) != 2:+ sys.exit(__doc__.strip().splitlines()[-1])+ main(sys.argv[1])diff --git a/themes/diwali/screenshot.jpg b/themes/diwali/screenshot.jpgnew file mode 100644index 000000000..d24c00fcdBinary files /dev/null and b/themes/diwali/screenshot.jpg differdiff --git a/themes/diwali/wallpapers/01-row-of-diyas.jpg b/themes/diwali/wallpapers/01-row-of-diyas.jpgnew file mode 100644index 000000000..4e60b1d15Binary files /dev/null and b/themes/diwali/wallpapers/01-row-of-diyas.jpg differdiff --git a/themes/diwali/wallpapers/02-rangoli-and-diyas.jpg b/themes/diwali/wallpapers/02-rangoli-and-diyas.jpgnew file mode 100644index 000000000..a6a05f5d8Binary files /dev/null and b/themes/diwali/wallpapers/02-rangoli-and-diyas.jpg differdiff --git a/themes/diwali/wallpapers/03-diyas-and-marigolds.jpg b/themes/diwali/wallpapers/03-diyas-and-marigolds.jpgnew file mode 100644index 000000000..92ae560bfBinary files /dev/null and b/themes/diwali/wallpapers/03-diyas-and-marigolds.jpg differdiff --git a/themes/diwali/wallpapers/04-akash-kandils.jpg b/themes/diwali/wallpapers/04-akash-kandils.jpgnew file mode 100644index 000000000..9e81282d1Binary files /dev/null and b/themes/diwali/wallpapers/04-akash-kandils.jpg differdiff --git a/themes/diwali/wallpapers/05-fireworks-over-the-city.jpg b/themes/diwali/wallpapers/05-fireworks-over-the-city.jpgnew file mode 100644index 000000000..ca2395082Binary files /dev/null and b/themes/diwali/wallpapers/05-fireworks-over-the-city.jpg differdiff --git a/themes/diwali/wallpapers/06-fireworks-over-the-lake.jpg b/themes/diwali/wallpapers/06-fireworks-over-the-lake.jpgnew file mode 100644index 000000000..4e16cb685Binary files /dev/null and b/themes/diwali/wallpapers/06-fireworks-over-the-lake.jpg differdiff --git a/themes/diwali/wallpapers/07-a-street-in-lights.jpg b/themes/diwali/wallpapers/07-a-street-in-lights.jpgnew file mode 100644index 000000000..5dc0abd51Binary files /dev/null and b/themes/diwali/wallpapers/07-a-street-in-lights.jpg differdiff --git a/themes/diwali/wallpapers/08-four-flames.jpg b/themes/diwali/wallpapers/08-four-flames.jpgnew file mode 100644index 000000000..03a97346eBinary files /dev/null and b/themes/diwali/wallpapers/08-four-flames.jpg differdiff --git a/themes/diwali/wallpapers/captions.txt b/themes/diwali/wallpapers/captions.txtnew file mode 100644index 000000000..935ff0741--- /dev/null+++ b/themes/diwali/wallpapers/captions.txt@@ -0,0 +1,8 @@+01-row-of-diyas.jpg A row of diyas · Slyronit, CC BY-SA 4.0+02-rangoli-and-diyas.jpg Diyas set in a rangoli · siddarth varanasi, CC BY 2.0+03-diyas-and-marigolds.jpg Diyas and marigolds · The open draft, CC BY-SA 4.0+04-akash-kandils.jpg Akash kandils for sale in Pune · Arya Joshi (आर्या जोशी), CC BY-SA 4.0+05-fireworks-over-the-city.jpg Diwali fireworks over the Yarra, Melbourne · Chris Phutully, CC BY 2.0+06-fireworks-over-the-lake.jpg Diwali fireworks over a lake, Chennai · Sriram Jagannathan, CC BY 2.0+07-a-street-in-lights.jpg A street in Diwali lights, Karnal · Arne Hückelheim, CC BY-SA 3.0+08-four-flames.jpg A diya with four flames · Moneysha26, CC BY-SA 4.0