refactor: remove skeleton toggle/shortcut feature from control server

show_skeleton is now managed by the Plasma wallpaper config directly,
so the server no longer needs toggle-skeleton, set-shortcut endpoints,
pynput hotkey listener, or the show_skeleton field in /current.
Also fixes unclosed file handle in the /art handler.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ltadeu6 2026-06-10 15:00:46 -03:00
parent 1453c3ba3c
commit db2fda70bd
No known key found for this signature in database
GPG key ID: FB9FDAB6B6F3418D

View file

@ -109,12 +109,12 @@ class ControlState:
verse_lines, verse_active = find_active_verse(verses, position) verse_lines, verse_active = find_active_verse(verses, position)
line = verse_lines[verse_active] if verse_active >= 0 and verse_lines else "" line = verse_lines[verse_active] if verse_active >= 0 and verse_lines else ""
return { return {
"art_url": getattr(self, "_art_url", None), "art_url": getattr(self, "_art_url", None),
"rgb": list(getattr(self, "_rgb", [0, 200, 255])), "rgb": list(getattr(self, "_rgb", [0, 200, 255])),
"rgb2": list(getattr(self, "_rgb2", [255, 0, 150])), "rgb2": list(getattr(self, "_rgb2", [255, 0, 150])),
"lyric_line": line, "lyric_line": line,
"verse_lines": verse_lines, "verse_lines": verse_lines,
"verse_active": verse_active, "verse_active": verse_active,
} }
@ -139,7 +139,8 @@ class ControlHandler(BaseHTTPRequestHandler):
return return
try: try:
if art_url.startswith("file://"): if art_url.startswith("file://"):
body = open(art_url[7:], "rb").read() with open(art_url[7:], "rb") as f:
body = f.read()
ctype = "image/png" if art_url.endswith(".png") else "image/jpeg" ctype = "image/png" if art_url.endswith(".png") else "image/jpeg"
else: else:
resp = requests.get(art_url, timeout=5) resp = requests.get(art_url, timeout=5)