Add folder support: keys that open sub-pages with a back key

A key with `folder: NAME` swaps the deck to the keys defined under
`folders.NAME`. Every folder shows a back key (slot 0 by default, drawn
with a built-in chevron) that pops back to the parent; folders nest.

The daemon now runs one page at a time: per-key setup moved into
setupKey(), openPage() draws a page under its own context, and
page.stop() tears it down before the next page is drawn (and on exit,
so device death no longer waits on uncancelled goroutines).

streamdeck-ctl gains `key set -folder`, reports kind "folder", lists
every folder in status, and refuses to `key press` a navigation-only
key. The Omarchy grid shows a folder glyph.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ARLa4moGb154fzc9TevgV
This commit is contained in:
Levi Woodard
2026-10-01 18:39:24 -06:00
parent c143db6b68
commit 4158165410
10 changed files with 568 additions and 153 deletions

View File

@@ -106,3 +106,21 @@ keys:
# 13:
# text_command: "date +%H:%M:%S"
# refresh: 1s
# Folders: a key with `folder:` opens a second page of keys. Every folder shows
# a back key (slot 0 by default, built-in arrow) that returns to the parent.
# Folders can open other folders.
#
# 7:
# icon: folder.png
# text: Media
# folder: media
#
# folders:
# media:
# back: # optional: key, icon, text, text_color
# key: 0
# keys:
# 1:
# icon: play.png
# command: playerctl play-pause