feat: per-pixel control and named color shortcuts - #21
Open
iksaif wants to merge 6 commits into
Open
Conversation
- Skip redundant plasma.show() calls when color/brightness hasn't changed (solid colors now only update once instead of every frame) - Skip pattern re-rendering when the animation row hasn't advanced - Replace FIFO readline busy-wait (time.time() polling loop) with select.select() for proper blocking I/O - Cache loaded PNG patterns instead of re-parsing on every switch
Clearing the flag inside the set_all() branch meant the buffer was written but never latched to the hardware, so solid colours never displayed. Patterns were unaffected because that branch leaves the flag set.
iksaif
force-pushed
the
feature-per-button-control
branch
from
August 25, 2026 12:21
347afe6 to
e829f2c
Compare
Tests cover: - FIFO.readline uses select.select for blocking I/O - Pattern caching avoids re-reading from disk - needs_update flag ensures show() only fires on state changes - Static color: show() called once, not every frame - Color/brightness changes trigger show() - FPS clamped to minimum 1
Add pipe protocol for external apps to control individual LEDs: - set <index> <r> <g> <b> / set <index> <color> — set a single pixel - unset <index> — clear a per-pixel override - clear — clear all per-pixel overrides - off — turn all LEDs off - <color_name> — set all LEDs to a named color Named colors: off, black, white, red, green, blue, yellow, cyan, purple, magenta, orange, dim_white. Hex colors (#ff0000) also supported. plasmactl gains --set, --unset, --clear, --off, --color (alias for --colour).
Tests cover: - parse_color: named colors, hex colors, integer colors, invalid inputs - Per-pixel overrides: set, unset, clear, off, out-of-range indices - plasmactl: NAMED_COLORS, Color function, send writes to FIFO
iksaif
force-pushed
the
feature-per-button-control
branch
from
August 25, 2026 13:14
e829f2c to
2f923c0
Compare
This was referenced Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: per-pixel control and named color shortcuts
Add a simple pipe protocol for external apps to control individual LEDs without crafting PNG patterns.
New pipe commands
set <index> <r> <g> <b>set <index> <color>unset <index>clearoff<color_name>Named colors:
off,black,white,red,green,blue,yellow,cyan,purple,magenta,orange,dim_whiteAlso supports hex colors:
#ff0000plasmactl updates
--set <index> <color|rgb>— set individual pixels--unset <index>— clear per-pixel override--clear— clear all overrides--off— turn all LEDs off--color— alias for--colour--setand--colourIncludes from #20
plasma.show()for static colorsselect.select()Tests
15 new unit tests covering
parse_color(named/hex/integer/invalid), per-pixel set/unset/clear/off, out-of-range pixel guard, and plasmactlColor()/send()writes to FIFO. All pass alongside the existing test suite.