mycue 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. mycue-0.2.0/.gitignore +7 -0
  2. mycue-0.2.0/CHANGELOG.md +110 -0
  3. mycue-0.2.0/CONTRIBUTING.md +36 -0
  4. mycue-0.2.0/LICENSE +21 -0
  5. mycue-0.2.0/NOTICE.md +16 -0
  6. mycue-0.2.0/PKG-INFO +314 -0
  7. mycue-0.2.0/README.md +282 -0
  8. mycue-0.2.0/docs/explanation/design.md +27 -0
  9. mycue-0.2.0/docs/explanation/how-it-works.md +54 -0
  10. mycue-0.2.0/docs/how-to/custom-widgets.md +64 -0
  11. mycue-0.2.0/docs/how-to/data-sources.md +80 -0
  12. mycue-0.2.0/docs/how-to/install.md +65 -0
  13. mycue-0.2.0/docs/how-to/pictures.md +99 -0
  14. mycue-0.2.0/docs/how-to/popups-alerts-issues.md +91 -0
  15. mycue-0.2.0/docs/how-to/run-on-plug-in.md +36 -0
  16. mycue-0.2.0/docs/how-to/theming.md +80 -0
  17. mycue-0.2.0/docs/images/screens.png +0 -0
  18. mycue-0.2.0/docs/index.md +35 -0
  19. mycue-0.2.0/docs/reference/cli.md +15 -0
  20. mycue-0.2.0/docs/reference/device.md +97 -0
  21. mycue-0.2.0/docs/reference/display.md +182 -0
  22. mycue-0.2.0/docs/reference/framework.md +163 -0
  23. mycue-0.2.0/docs/reference/theme.md +126 -0
  24. mycue-0.2.0/docs/tutorial.md +142 -0
  25. mycue-0.2.0/examples/art.py +65 -0
  26. mycue-0.2.0/examples/custom_widget.py +37 -0
  27. mycue-0.2.0/examples/hello.py +18 -0
  28. mycue-0.2.0/examples/now_playing.py +49 -0
  29. mycue-0.2.0/examples/pomodoro.py +68 -0
  30. mycue-0.2.0/examples/stopwatch.py +46 -0
  31. mycue-0.2.0/examples/system_stats.py +48 -0
  32. mycue-0.2.0/examples/theming.py +33 -0
  33. mycue-0.2.0/examples/website_check.py +49 -0
  34. mycue-0.2.0/licenses/NexusTool-MIT.txt +21 -0
  35. mycue-0.2.0/pyproject.toml +52 -0
  36. mycue-0.2.0/src/mycue/__init__.py +61 -0
  37. mycue-0.2.0/src/mycue/app.py +477 -0
  38. mycue-0.2.0/src/mycue/canvas.py +145 -0
  39. mycue-0.2.0/src/mycue/cli.py +185 -0
  40. mycue-0.2.0/src/mycue/device.py +255 -0
  41. mycue-0.2.0/src/mycue/display.py +613 -0
  42. mycue-0.2.0/src/mycue/issues.py +70 -0
  43. mycue-0.2.0/src/mycue/launchd.py +89 -0
  44. mycue-0.2.0/src/mycue/logpage.py +107 -0
  45. mycue-0.2.0/src/mycue/media.py +116 -0
  46. mycue-0.2.0/src/mycue/nexus-launch.c +31 -0
  47. mycue-0.2.0/src/mycue/poll.py +102 -0
  48. mycue-0.2.0/src/mycue/popup.py +155 -0
  49. mycue-0.2.0/src/mycue/py.typed +0 -0
  50. mycue-0.2.0/src/mycue/render.py +514 -0
  51. mycue-0.2.0/src/mycue/run.py +85 -0
  52. mycue-0.2.0/src/mycue/tabs.py +179 -0
  53. mycue-0.2.0/src/mycue/theme.py +247 -0
  54. mycue-0.2.0/src/mycue/widgets.py +241 -0
  55. mycue-0.2.0/tests/__init__.py +0 -0
  56. mycue-0.2.0/tests/test_app.py +312 -0
  57. mycue-0.2.0/tests/test_canvas.py +90 -0
  58. mycue-0.2.0/tests/test_device.py +153 -0
  59. mycue-0.2.0/tests/test_display.py +171 -0
  60. mycue-0.2.0/tests/test_examples.py +23 -0
  61. mycue-0.2.0/tests/test_launchd_cli.py +77 -0
  62. mycue-0.2.0/tests/test_media.py +149 -0
  63. mycue-0.2.0/tests/test_poll.py +41 -0
  64. mycue-0.2.0/tests/test_popup.py +338 -0
  65. mycue-0.2.0/tests/test_run.py +85 -0
  66. mycue-0.2.0/tests/test_theme.py +168 -0
  67. mycue-0.2.0/tests/test_widgets_tabs.py +331 -0
  68. mycue-0.2.0/udev/99-icuenexus.rules +1 -0
mycue-0.2.0/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ __pycache__/
2
+ .venv/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ *.pyc
6
+ dist/
7
+ site/
@@ -0,0 +1,110 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0] - 2026-12-04
10
+
11
+ ### Added
12
+
13
+ - A card can round its own corners: `radius=` on every `ui` card, or `Widget.radius`,
14
+ overriding `Theme.radius`. The Theme now refuses a negative radius, margin or gap.
15
+ - Your own art: `ui.canvas(paint)` paints a card with `paint(canvas, now)`, and
16
+ `Sketch(paint)` goes anywhere a picture does (a slide, a background). `Canvas` has
17
+ pixels, lines, rectangles, circles, text and pictures, with `scale` for chunky pixels and
18
+ `every` for animation. `examples/art.py` shows them.
19
+ - `ui.picture(source)` and `PictureWidget`: a picture or GIF on a card, or edge to edge with
20
+ `card=False`. `ui.slide(source)` and `Slide`: a page that is one picture.
21
+ - Pictures: `Picture(source, fit=, smooth=)` loads a still image or an animated GIF (APNG,
22
+ WebP), fitted to its box by `cover`, `contain`, `stretch`, `tile` or `none`.
23
+ `Theme.background` draws one behind everything, and a tab's theme can set its own.
24
+ Animations play at their own speed: the run loop redraws when the next frame is due
25
+ (`render.wake`, `App.wake_in`), at most `Theme.frame_rate` times a second.
26
+ - A tab can have its own theme: `Tab(theme=)` and `ui.tab(theme=)` take a `Theme` or a dict
27
+ of fields to change, such as `bg`, `panel`, `card_opacity`, `margin` and `gap`.
28
+ - `Theme.card_opacity` (default 1.0, opaque) lets the surface show through cards.
29
+ - Tab alerts: `ui.alert(..., tab=True)` and `Tab.add_alert`. The banner shows only on its
30
+ tab, a swipe can leave it, and the tab's page dot takes its colour meanwhile.
31
+ `switch=True` (or `Theme.alert_switch`) jumps to the tab when it starts. App-wide alerts
32
+ win.
33
+ - Buttons: `ui.button(label, action)` and `ButtonWidget` run a function when tapped, on a
34
+ thread of their own, and show running, then done or failed. With confirm (the default)
35
+ a second tap within 3 s runs it, so brushing the strip runs nothing.
36
+ - Theme fields for behaviour, each overridable per item: `confirm_for`, `alert_confirm`,
37
+ `button_confirm`, `button_show_for`.
38
+ - Popup and log defaults on the Theme, each overridable per popup or log: `popup_exits`,
39
+ `popup_idle`, `popup_transition`, `popup_confirm` (False closes on one tap),
40
+ `double_tap_for`, `log_scroll_every`, `log_hold`, `log_empty`, `log_empty_tone`. `Log` and
41
+ `ui.log` take `scroll_every`, `hold` and the Popup's arguments.
42
+ - App and card defaults on the Theme: `alert_timeout`, `alert_tone`, `home_after`,
43
+ `button_text`, `clock_format`, `text_tone`. `Display` and `App` take their timeouts from it
44
+ when the argument is left out; None still means never.
45
+ - `ui.alert(..., confirm=, dismiss=)` and the same on `Banner`: confirm off hides on one
46
+ tap; `dismiss` is a function that hides the banner as if tapped.
47
+ - `tap_when=` on `StatWidget` and `ui.stat`: a tap target that is live, and
48
+ marked, only while a function is true, so a card whose log would be empty is not tappable.
49
+ The issues count uses it: no mark and no tap while there are no issues.
50
+ - `Calibration` corrects the touch panel's x to screen x, defaulting to the fit measured on a
51
+ Nexus. `mycue calibrate` measures your own; pass it to `Display`, `Nexus.open` or `serve`.
52
+ - A tap mark in the top-right corner of every card a tap opens, or in the header when the
53
+ whole tab is tappable. The theme sets its shape (`tap_mark`: dot, ring, square, diamond,
54
+ star, finger, none, or a function), `tap_colour` and `tap_size`. It defaults to an accent
55
+ dot.
56
+
57
+ - `Display.run(exit=True)` and `mycue.run.exit_now()` leave the process at once when the
58
+ Nexus goes away, without waiting on source threads.
59
+
60
+ - `clocked=True` on `Display.stat` and `StatWidget` passes the frame's time to the value,
61
+ tone and meter functions, so a card can count down between polls.
62
+
63
+ - `@ui.every(seconds)` makes a function a source: it is fetched on its own thread, and
64
+ calling it returns the latest value. A `Poller` is callable for the same.
65
+
66
+ ### Changed
67
+
68
+ - A banner hides on a second tap by default, the first saying "tap again to hide", so a
69
+ stray touch can't clear an alert. `Theme(alert_confirm=False)` or `confirm=False` restores
70
+ one tap.
71
+ - A stat card greys out while any source it reads is stale, found by noting which sources'
72
+ `.value` it touches as it draws; `source=` is no longer needed for that.
73
+
74
+ - New data shows at once: a source finishing a poll wakes the run loop, instead of the
75
+ screen waiting up to a second for its next idle redraw.
76
+
77
+ - Only cards open things. `Tab` and `ui.tab` no longer take `tap`: a heading tap that took
78
+ over taps on a tab's cards was confusing, so a tab that opens something gives a card the
79
+ `tap`. A tap goes to the card under the finger, or the nearest one, and does nothing on a
80
+ card that isn't tappable or on the header. `Widget.tappable` says which cards count.
81
+
82
+ ### Fixed
83
+
84
+ - The issues count no longer greys out when a source its checks read goes stale; it reports
85
+ staleness itself. `StatWidget(track=False)` does the same for other summary cards.
86
+ - The star tap mark is a pixel wider than `tap_size`, since a star covers less of its box
87
+ than a dot and read smaller.
88
+ - The star tap mark is drawn antialiased and symmetric. Pillow's polygon fill rounded it
89
+ lopsided at a few pixels, missing an arm at the default size.
90
+ - Every stock tap mark fills the same `tap_size` box as the dot. The star, diamond and
91
+ finger were drawn larger, the finger nearly twice as tall.
92
+ - The tap mark's dot and ring are `tap_size` pixels across; the default dot was a pixel
93
+ wider than a status dot.
94
+ - A tap in the gap between cards, or past the last one, goes to the nearest card instead of
95
+ missing.
96
+ - Frames are sent as BGRA, the order the Nexus takes. Red and blue were swapped on the device.
97
+
98
+ ## [0.1.0]
99
+
100
+ First version, not published to PyPI.
101
+
102
+ - Nexus device layer: frames, brightness, blank, info, and touch with tap and swipe gestures.
103
+ The protocol is ported from NexusTool.
104
+ - Framework: App, Page, Tab, Widget, StatWidget, ClockWidget, MessageWidget, Popup,
105
+ ScrollLog, Issues, Banner, Poller, and the run loop.
106
+ - Display: the declarative, one-line-per-card API, with `preview()`.
107
+ - Theme: every colour, font, size, spacing, threshold and animation setting, with dark and
108
+ light presets.
109
+ - `mycue` CLI: info, brightness, test, image, touch, demo, and launchd install and uninstall.
110
+ - Docs, examples and the Linux udev rule.
@@ -0,0 +1,36 @@
1
+ # Contributing
2
+
3
+ Thanks for helping. Bug reports, device reports and pull requests are all welcome.
4
+
5
+ ## Reporting
6
+
7
+ - **A bug**: what you ran, what you expected, what happened, the output of `mycue info`, your
8
+ OS, and your Python version.
9
+ - **A device or platform report** (Linux, Windows, another Corsair display): whether
10
+ `mycue info`, `mycue test` and `mycue touch 10` work, and anything you had to change.
11
+
12
+ ## Developing
13
+
14
+ ```sh
15
+ uv sync # Python 3.12+, dev tools included
16
+ uv run pytest # no device needed
17
+ uv run ruff check --fix . && uv run ruff format .
18
+ ```
19
+
20
+ - Keep pull requests small and focused, one change each.
21
+ - Add or update tests with every change. The device is mocked in tests, so anything that draws
22
+ can be checked with `App.frame()` or `Display.preview()`.
23
+ - If you change how things look, render a preview and look at it. Include it in the PR.
24
+ - If you change behaviour, update the docs in `docs/`, and add a line to CHANGELOG.md under
25
+ Unreleased.
26
+ - Stop any running mycue app or launchd agent before testing on the device: only one program
27
+ can hold it.
28
+
29
+ ## Releasing
30
+
31
+ 1. Bump `version` in `pyproject.toml` and `__version__` in `src/mycue/__init__.py`, and move
32
+ the Unreleased entries in CHANGELOG.md under the new version.
33
+ 2. Merge that to main.
34
+ 3. Create a GitHub release with the tag `vX.Y.Z`, for example
35
+ `gh release create v0.1.0 --generate-notes`. The release workflow runs the tests, checks
36
+ that the tag matches the version, builds, and publishes to PyPI.
mycue-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 spuddydev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
mycue-0.2.0/NOTICE.md ADDED
@@ -0,0 +1,16 @@
1
+ # Third-party notices
2
+
3
+ mycue is MIT licensed (see `LICENSE`). It includes work derived from the projects below,
4
+ whose licenses are kept in `licenses/`.
5
+
6
+ ## NexusTool
7
+
8
+ - Source: https://github.com/willneedit/NexusTool
9
+ - Copyright (c) 2025 willneedit, MIT License: `licenses/NexusTool-MIT.txt`
10
+ - Ported from commit `8f8c18e22e352fbc653e3fa650dfb05a2c4ff2f8` (2025-05-27), file
11
+ `NexusTool/Nexus.cs`.
12
+ - What was used: the iCUE Nexus HID protocol in `src/mycue/device.py`. That covers the device
13
+ IDs and usage page, the frame report layout, the brightness, blank and animation feature
14
+ reports, the firmware query, and the touch report format.
15
+ - `udev/99-icuenexus.rules` is NexusTool's udev rule (`_etc_udev_rules.d/99-icuenexus.rules`),
16
+ unchanged.
mycue-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,314 @@
1
+ Metadata-Version: 2.5
2
+ Name: mycue
3
+ Version: 0.2.0
4
+ Summary: Drive the Corsair iCUE Nexus touchscreen from Python, without iCUE, and build glanceable displays on it
5
+ Project-URL: Homepage, https://github.com/spuddydev/mycue
6
+ Project-URL: Documentation, https://spuddydev.github.io/mycue/
7
+ Project-URL: Source, https://github.com/spuddydev/mycue
8
+ Project-URL: Issues, https://github.com/spuddydev/mycue/issues
9
+ Project-URL: Changelog, https://github.com/spuddydev/mycue/blob/main/CHANGELOG.md
10
+ Author: spuddydev
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ License-File: NOTICE.md
14
+ License-File: licenses/NexusTool-MIT.txt
15
+ Keywords: corsair,dashboard,display,hid,icue,keyboard,nexus,touchscreen
16
+ Classifier: Development Status :: 3 - Alpha
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3 :: Only
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Topic :: System :: Hardware :: Universal Serial Bus (USB) :: Human Interface Device (HID)
26
+ Classifier: Topic :: System :: Monitoring
27
+ Classifier: Typing :: Typed
28
+ Requires-Python: >=3.12
29
+ Requires-Dist: hidapi>=0.14
30
+ Requires-Dist: pillow>=11
31
+ Description-Content-Type: text/markdown
32
+
33
+ # mycue
34
+
35
+ **Drive the Corsair iCUE Nexus touchscreen from Python, without iCUE, and build your own
36
+ glanceable display on it in a few lines.**
37
+
38
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue)](https://www.python.org)
39
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://github.com/spuddydev/mycue/blob/main/LICENSE)
40
+ ![Status: alpha](https://img.shields.io/badge/status-alpha-orange)
41
+ [![Docs](https://img.shields.io/badge/docs-spuddydev.github.io%2Fmycue-blue)](https://spuddydev.github.io/mycue/)
42
+
43
+ ![Two screens drawn by mycue: a home tab with a clock and issue count, and a website check](https://raw.githubusercontent.com/spuddydev/mycue/main/docs/images/screens.png)
44
+
45
+ ```python
46
+ import mycue as mc
47
+
48
+ ui = mc.Display()
49
+
50
+
51
+ @ui.every(10) # runs on its own thread; nas() returns the latest result at once
52
+ def nas():
53
+ return fetch_nas()
54
+
55
+
56
+ with ui.tab("home", home=True):
57
+ ui.clock()
58
+ ui.issues()
59
+
60
+ with ui.tab("nas", "homelab", source=nas):
61
+ ui.stat("CPU", lambda: nas()["cpu"], fmt="{:.0%}", meter=True)
62
+ ui.stat("TEMP", lambda: nas()["temp"], unit="°C", warn=70, bad=85)
63
+
64
+ ui.alert("Backup failed", when=lambda: not nas()["backup_ok"])
65
+ ui.run()
66
+ ```
67
+
68
+ ## Motivation
69
+
70
+ The iCUE Nexus is a 640x48 touchscreen that clips onto the top of a Corsair keyboard. It sits
71
+ right where your eyes drop for a second while you type, which makes it a good place for the
72
+ few things you want to know at a glance: whether the build passed, whether the server is
73
+ healthy, whether the backup ran.
74
+
75
+ Officially it is driven by iCUE, Corsair's large application built mostly around RGB
76
+ lighting. Using it as *your* display means drawing its pixels and reading its touches
77
+ yourself. [NexusTool](https://github.com/willneedit/NexusTool) worked out how to do that
78
+ and made a small command-line tool. mycue builds on that protocol work and turns it into a
79
+ Python library, so a display of your own is a short script instead of a project:
80
+
81
+ - **No iCUE.** mycue talks to the device directly over HID.
82
+ - **Easy by default.** One line per card, and functions for anything live.
83
+ - **Configurable all the way down.** Every colour, font, size and timing is a theme field,
84
+ and every Display call is a thin layer over public classes you can use or subclass.
85
+ - **Built for a glance.** The defaults come from running it all day: calm cards, status as
86
+ dots rather than coloured numbers, and stale data greyed out rather than shown as current.
87
+
88
+ ## The device and compatibility
89
+
90
+ | | |
91
+ | --- | --- |
92
+ | Device | Corsair **iCUE Nexus** companion touchscreen |
93
+ | USB IDs | `1b1c:1b8e` (Corsair, iCUE Nexus), HID usage page 12 |
94
+ | Screen | 640 x 48 pixels, full colour, brightness 0 to 100 |
95
+ | Touch | one finger, horizontal position only: taps and left/right swipes |
96
+ | Speed | about 40 ms to upload a frame, so up to about 20 fps for animation |
97
+
98
+ | Platform | Status |
99
+ | --- | --- |
100
+ | macOS 15 (Apple silicon) | **Tested.** Includes a launchd agent that runs your app when the Nexus is plugged in |
101
+ | Linux | Expected to work (plain HID; NexusTool runs there). Needs the [udev rule](https://github.com/spuddydev/mycue/blob/main/udev/99-icuenexus.rules). Untested |
102
+ | Windows | Untested. hidapi supports it, but Corsair's services may hold the device |
103
+
104
+ | Python | Status |
105
+ | --- | --- |
106
+ | 3.12, 3.13, 3.14 | Tests pass |
107
+
108
+ iCUE (or anything else holding the device) must be closed: only one program can drive the
109
+ Nexus at a time. mycue has not been tested with other Corsair displays, and they almost
110
+ certainly speak a different protocol. If you try one, please open an issue.
111
+
112
+ ## Features
113
+
114
+ - **Device layer**: frames, brightness, blanking, device info, and touch with tap and swipe
115
+ detection (`mycue.Nexus`).
116
+ - **Display**: a declarative, Streamlit-style API. Tabs you swipe between, stat cards with
117
+ formatting, meters and status dots, clocks, text, and custom widgets.
118
+ - **Live data**: sources poll on their own threads. Stale data greys out, and a failing source
119
+ or card never takes the display down.
120
+ - **Taps**: scrolling log popups, multi-tab popups, and a home tab the screen returns to.
121
+ - **Alerts and issues**: banners while a condition holds, and one issue list fed from
122
+ anywhere.
123
+ - **Theme**: colours, fonts (any TTF or OTF, including variable-font styles), sizes, spacing,
124
+ meter thresholds and animation, with dark and light presets.
125
+ - **Preview without the device**: render every tab to a PNG.
126
+ - **Runs on plug-in** (macOS): one command installs a launchd agent.
127
+ - **Typed**, with two runtime dependencies: `hidapi` and `Pillow`.
128
+
129
+ ## Install
130
+
131
+ ```sh
132
+ pip install mycue # or: uv add mycue
133
+ ```
134
+
135
+ You need Python 3.12 or later. The `hidapi` wheel includes the native library, so there is
136
+ usually nothing else to install. On Linux, also install the udev rule:
137
+
138
+ ```sh
139
+ sudo cp udev/99-icuenexus.rules /etc/udev/rules.d/
140
+ sudo udevadm control --reload-rules && sudo udevadm trigger # then replug the Nexus
141
+ ```
142
+
143
+ The rule file is in the [repository](https://github.com/spuddydev/mycue/blob/main/udev/99-icuenexus.rules).
144
+
145
+ ## Quickstart
146
+
147
+ 1. **Close iCUE.** Stop it starting at login too.
148
+ 2. **Check that the device answers:**
149
+
150
+ ```sh
151
+ mycue info # manufacturer, product, serial, firmware
152
+ mycue test # colour bars on the strip
153
+ mycue touch 10 # tap and swipe; each gesture prints
154
+ mycue calibrate # optional: if taps land off, measure your panel
155
+ mycue demo # a demo app; Ctrl-C to stop
156
+ ```
157
+
158
+ 3. **Write `app.py`:**
159
+
160
+ ```python
161
+ import shutil
162
+
163
+ import mycue as mc
164
+
165
+ ui = mc.Display()
166
+
167
+
168
+ @ui.every(30)
169
+ def disk():
170
+ u = shutil.disk_usage("/")
171
+ return {"used": u.used / u.total, "free_gb": u.free / 1e9}
172
+
173
+
174
+ with ui.tab("home", home=True):
175
+ ui.clock()
176
+ ui.issues()
177
+
178
+ with ui.tab("disk", source=disk):
179
+ ui.stat("USED", lambda: disk()["used"], fmt="{:.0%}", meter=True)
180
+ ui.stat("FREE", lambda: disk()["free_gb"], fmt="{:.0f}", unit=" GB", warn=50, bad=10)
181
+
182
+ ui.issue("disk", lambda: ["under 10 GB free"] if disk()["free_gb"] < 10 else [])
183
+ ui.run(exit=True)
184
+ ```
185
+
186
+ 4. **Run it:** `python app.py`. Swipe between the tabs. The screen returns home after 30 s.
187
+
188
+ 5. **See it without the device:** `ui.preview("preview.png")`.
189
+
190
+ The [tutorial](https://github.com/spuddydev/mycue/blob/main/docs/tutorial.md) walks through this step by step, and
191
+ [examples/](https://github.com/spuddydev/mycue/blob/main/examples) has more.
192
+
193
+ ## Examples
194
+
195
+ Each runs with `uv run python examples/<name>.py`, and each one's `build()` renders without a
196
+ Nexus (`build().preview("out.png")`).
197
+
198
+ | Example | What it shows |
199
+ | --- | --- |
200
+ | `hello.py` | the smallest app: a clock and one number |
201
+ | `system_stats.py` | this Mac's load, disk and uptime from the standard library |
202
+ | `website_check.py` | a source with retries, a popup log of checks, and an alert |
203
+ | `custom_widget.py` | a widget of your own, drawn into its box |
204
+ | `theming.py` | colours, fonts and spacing |
205
+ | `pomodoro.py` | a button that starts and stops a 25/5 loop, clocked cards, and a tab alert at each phase change |
206
+ | `now_playing.py` | a track card and one-tap play/pause and next buttons, over a stub player |
207
+ | `stopwatch.py` | the smallest clocked card, with a one-tap start/stop and a two-tap reset |
208
+ | `art.py` | generated art: a pixel heart and a wave on cards, and a starfield page, each painted on a canvas |
209
+
210
+ ## Make it yours
211
+
212
+ Every visual choice is a [Theme](https://github.com/spuddydev/mycue/blob/main/docs/reference/theme.md) field:
213
+
214
+ ```python
215
+ ui = mc.Display(
216
+ theme=mc.Theme.dark(
217
+ accent="#f97316",
218
+ font="~/Library/Fonts/Inter.ttf",
219
+ radius=10,
220
+ gap=6,
221
+ meter_warn=0.6,
222
+ title_width=0, # no header card
223
+ ),
224
+ brightness=60,
225
+ home_after=20,
226
+ banner_timeout=None, # alerts stay until tapped
227
+ )
228
+ ```
229
+
230
+ The tap mark that shows a card opens something is themeable too: `tap_mark="star"` (or
231
+ `ring`, `square`, `diamond`, `finger`, `none`, or your own function), `tap_colour`, `tap_size`.
232
+
233
+ Cards take keyword arguments for everything: `fmt`, `unit`, `meter`, `lo`/`hi`,
234
+ `tone`, `warn`/`bad` (which can run downward), `size`, `visible`, `tap` and
235
+ `source`. Tabs take `sub`, `tone`, `visible`, `message`, `tap`, `home` and `head`.
236
+ For anything Display doesn't cover:
237
+
238
+ - write a [custom widget](https://github.com/spuddydev/mycue/blob/main/docs/how-to/custom-widgets.md) by drawing with Pillow,
239
+ - subclass `Page` to own the whole screen,
240
+ - or skip Display and use [the framework](https://github.com/spuddydev/mycue/blob/main/docs/reference/framework.md) (`App`, `Tab`,
241
+ `Popup`, `Poller`) or [the device](https://github.com/spuddydev/mycue/blob/main/docs/reference/device.md) directly.
242
+
243
+ ## Run it whenever the Nexus is plugged in
244
+
245
+ On macOS:
246
+
247
+ ```sh
248
+ mycue launchd install com.example.mydisplay -- /absolute/path/to/python /absolute/path/to/app.py
249
+ mycue launchd uninstall com.example.mydisplay
250
+ ```
251
+
252
+ launchd starts your app when the Nexus attaches, and the app exits when it is unplugged.
253
+ Nothing runs in between. The log is `~/Library/Logs/<label>.log`. You need the Xcode command
254
+ line tools, which compile a tiny launcher. [More](https://github.com/spuddydev/mycue/blob/main/docs/how-to/run-on-plug-in.md).
255
+
256
+ ## Command line
257
+
258
+ ```
259
+ mycue info | brightness LEVEL | test | image PATH | touch SECONDS | calibrate | demo
260
+ mycue launchd install LABEL -- COMMAND... | launchd uninstall LABEL
261
+ ```
262
+
263
+ ## Troubleshooting
264
+
265
+ | Symptom | Fix |
266
+ | --- | --- |
267
+ | `iCUE Nexus not connected` | Plug it in, quit iCUE, and stop any other mycue app or launchd agent: only one program can hold it |
268
+ | Permission denied (Linux) | Install the udev rule and replug |
269
+ | `write to Nexus failed` | It was unplugged, or a hub dropped it. Plug it straight into the computer |
270
+ | Plain or blocky text | No system font found. Set `font=` in the Theme |
271
+ | Card shows `--` | Its value was None or raised. Check the value function, or the source's `.error` |
272
+ | Tab header says `stale` | Its source hasn't answered for 3 intervals plus 10 s. See the log (logger `mycue.poll`) |
273
+
274
+ [Full troubleshooting](https://github.com/spuddydev/mycue/blob/main/docs/how-to/install.md#troubleshooting).
275
+
276
+ ## Documentation
277
+
278
+ The full docs are at **[spuddydev.github.io/mycue](https://spuddydev.github.io/mycue/)**, with the source in
279
+ [docs/](https://github.com/spuddydev/mycue/tree/main/docs):
280
+
281
+ - **Tutorial**: [your first display](https://github.com/spuddydev/mycue/blob/main/docs/tutorial.md)
282
+ - **How-to**: [install](https://github.com/spuddydev/mycue/blob/main/docs/how-to/install.md), [live data](https://github.com/spuddydev/mycue/blob/main/docs/how-to/data-sources.md),
283
+ [theming](https://github.com/spuddydev/mycue/blob/main/docs/how-to/theming.md), [popups, alerts and issues](https://github.com/spuddydev/mycue/blob/main/docs/how-to/popups-alerts-issues.md),
284
+ [pictures and GIFs](https://github.com/spuddydev/mycue/blob/main/docs/how-to/pictures.md), [custom widgets](https://github.com/spuddydev/mycue/blob/main/docs/how-to/custom-widgets.md), [run on plug-in](https://github.com/spuddydev/mycue/blob/main/docs/how-to/run-on-plug-in.md)
285
+ - **Reference**: [Display](https://github.com/spuddydev/mycue/blob/main/docs/reference/display.md), [Theme](https://github.com/spuddydev/mycue/blob/main/docs/reference/theme.md),
286
+ [framework](https://github.com/spuddydev/mycue/blob/main/docs/reference/framework.md), [device and protocol](https://github.com/spuddydev/mycue/blob/main/docs/reference/device.md),
287
+ [CLI](https://github.com/spuddydev/mycue/blob/main/docs/reference/cli.md)
288
+ - **Explanation**: [how it works](https://github.com/spuddydev/mycue/blob/main/docs/explanation/how-it-works.md),
289
+ [designing for a 48 px strip](https://github.com/spuddydev/mycue/blob/main/docs/explanation/design.md)
290
+
291
+ ## Contributing
292
+
293
+ Issues and pull requests are welcome, especially reports from Linux, Windows and other
294
+ Corsair devices. See [CONTRIBUTING.md](https://github.com/spuddydev/mycue/blob/main/CONTRIBUTING.md). In short:
295
+
296
+ ```sh
297
+ uv sync
298
+ uv run pytest
299
+ uv run ruff check . && uv run ruff format .
300
+ ```
301
+
302
+ ## Credits
303
+
304
+ - **[NexusTool](https://github.com/willneedit/NexusTool)** by willneedit (MIT) worked out the
305
+ Nexus HID protocol. mycue's device layer is a port of it, and the Linux udev rule is
306
+ NexusTool's. Thank you. Its license is in [licenses/NexusTool-MIT.txt](https://github.com/spuddydev/mycue/blob/main/licenses/NexusTool-MIT.txt), with
307
+ details in [NOTICE.md](https://github.com/spuddydev/mycue/blob/main/NOTICE.md).
308
+ - [hidapi](https://github.com/libusb/hidapi) and its [Python binding](https://github.com/trezor/cython-hidapi)
309
+ handle the USB side, and [Pillow](https://python-pillow.org) does the drawing.
310
+
311
+ ## License
312
+
313
+ [MIT](https://github.com/spuddydev/mycue/blob/main/LICENSE) © 2026 spuddydev. Includes MIT-licensed work from NexusTool; see
314
+ [NOTICE.md](https://github.com/spuddydev/mycue/blob/main/NOTICE.md).