JohnWayneeee/cleantv / skills/android-tv-setup
android-tv-setup
UnverifiedSet up an Android TV or Google TV over network ADB - back up, debloat with the owner's choices, switch off screen recognition (ACR) and take the microphone and camera away from vendor apps, tune performance, set picture and sound like a calibrator, replace the home screen with a clean Apple TV style launcher, and set up a YouTube DPI bypass (ByeByeDPI) where the ISP throttles YouTube, verifying every step with screenshots from the TV. Use when the user wants to debloat, clean up, speed up, configure, calibrate or replace the launcher on an Android TV / Google TV set or box (Xiaomi, TCL, Hisense, Sony, Philips, CHiQ/Changhong, Haier, Nvidia Shield and others). Not for Samsung Tizen, LG webOS or Fire TV launchers.
scripts/setting.py
View on GitHub#!/usr/bin/env python3
"""Change Android settings and remember the original values for restore.py.
setting.py put global window_animation_scale 0.5 [key value ...]
setting.py get global picture_mode picture_backlight
setting.py list global picture_ # keys starting with a prefix
The first original value of each key is kept in backup/settings-changes.tsv
(namespace, key, original value; "null" means the key did not exist).
"""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from tvlib import BACKUP, ensure_backup_dir, sh # noqa: E402
LOG = os.path.join(BACKUP, "settings-changes.tsv")
NAMESPACES = ("global", "secure", "system")
def recorded():
if not os.path.exists(LOG):
return set()
return {tuple(l.rstrip("\n").split("\t")[:2]) for l in open(LOG, encoding="utf-8") if l.strip()}
def put(ns, pairs):
ensure_backup_dir()
seen = recorded()
with open(LOG, "a", encoding="utf-8") as log:
for key, value in pairs:
old = sh(f"settings get {ns} {key}")
if (ns, key) not in seen:
log.write(f"{ns}\t{key}\t{old}\n")
seen.add((ns, key))
sh(f"settings put {ns} {key} {value}")
new = sh(f"settings get {ns} {key}")
print(f"{ns} {key}: {old} -> {new}" + ("" if new == value else " (MISMATCH)"))
def main(a):
if len(a) < 3 or a[1] not in NAMESPACES:
sys.exit(__doc__)
cmd, ns, rest = a[0], a[1], a[2:]
if cmd == "put" and len(rest) % 2 == 0:
put(ns, list(zip(rest[::2], rest[1::2])))
elif cmd == "get":
for k in rest:
print(f"{k}={sh(f'settings get {ns} {k}')}")
elif cmd == "list":
for line in sh(f"settings list {ns}").splitlines():
if any(line.startswith(p) for p in rest):
print(line)
else:
sys.exit(__doc__)
if __name__ == "__main__":
main(sys.argv[1:])
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |