kovarctl 0.1.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.
kovarctl-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lars Kiesow
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.
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: kovarctl
3
+ Version: 0.1.0
4
+ Summary: Control the lighting of KOVAR keyboards (ROYUAN YC500 firmware) on Linux
5
+ Author-email: Lars Kiesow <lkiesow@uos.de>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/lkiesow/kovarctl
8
+ Project-URL: Issues, https://github.com/lkiesow/kovarctl/issues
9
+ Keywords: kovar,keyboard,rgb,lighting,hidraw
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: System :: Hardware
15
+ Requires-Python: >=3.13
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: click>=8
19
+ Dynamic: license-file
20
+
21
+ # kovarctl
22
+
23
+ Command line tool for the lighting of KOVAR keyboards (ROYUAN YC500 firmware, USB ID `3151:4010`) on Linux.
24
+
25
+ Supported models, identified by the firmware model ID:
26
+
27
+ | ID | Model | Tested |
28
+ |-----|-----------------------------|--------|
29
+ | 738 | KOVAR | yes |
30
+ | 723 | KOVAR Wireless (USB cable) | yes |
31
+ | 737 | KOVAR TKL | no |
32
+ | 736 | KOVAR 60 | no |
33
+
34
+ The 2.4 GHz dongle (`3151:4011`) is not supported, because it uses a different protocol. Connect the keyboard with a USB cable instead.
35
+
36
+ ## Installation
37
+
38
+ ```sh
39
+ pipx install kovarctl
40
+ ```
41
+
42
+ `pip install --user kovarctl` and `uv tool install kovarctl` work as well.
43
+
44
+ The only dependency is [click](https://click.palletsprojects.com/). Your user needs access to the keyboard's `/dev/hidraw*` nodes. Desktop sessions usually grant it, and the OpenRGB udev rules do too.
45
+
46
+ ## Usage
47
+
48
+ ```sh
49
+ kovarctl list # connected keyboards
50
+ kovarctl info # model, firmware, current lighting
51
+ kovarctl effects # effects and their options
52
+ kovarctl mode wave --direction left --color 00ffff
53
+ kovarctl mode breathing --speed 3 # options not given stay as they are
54
+ kovarctl mode static --rainbow
55
+ kovarctl off
56
+ kovarctl side breathing --color red # side light
57
+ kovarctl live ff8000 # one color for all keys, no flash write
58
+ kovarctl live --fade 30 # rainbow fade for 30 s
59
+ some-program | kovarctl live --stdin # one color per line
60
+ kovarctl keys # key names
61
+ kovarctl custom set escape=red w=green --activate
62
+ kovarctl custom set all=000040
63
+ kovarctl custom save picture.json
64
+ kovarctl custom load picture.json --activate
65
+ kovarctl recover # if the keyboard stopped answering
66
+ ```
67
+
68
+ Use `--dry-run` to see what would be written, `-v` to report flash writes, and `--device` or `--id` to choose a keyboard when several are connected.
69
+
70
+ ## Shell completion
71
+
72
+ kovarctl can complete commands, effect names and option values such as `--direction`. This needs the installed `kovarctl` command; it does not work with `python3 -m kovarctl`.
73
+
74
+ **Bash** (version 4.4 or newer), add to `~/.bashrc`:
75
+
76
+ ```sh
77
+ eval "$(_KOVARCTL_COMPLETE=bash_source kovarctl)"
78
+ ```
79
+
80
+ **Zsh**, add to `~/.zshrc` after `compinit` has run (frameworks like Oh My Zsh run it for you):
81
+
82
+ ```sh
83
+ eval "$(_KOVARCTL_COMPLETE=zsh_source kovarctl)"
84
+ ```
85
+
86
+ **Fish**, add to `~/.config/fish/config.fish`:
87
+
88
+ ```sh
89
+ _KOVARCTL_COMPLETE=fish_source kovarctl | source
90
+ ```
91
+
92
+ Open a new shell afterwards. The completion is generated each time a shell starts (about 30 ms), so it always matches the installed version.
93
+
94
+ ## Keyboard flash
95
+
96
+ The keyboard stores effect settings, the side light and the custom picture in its flash memory. Each write keeps the firmware busy for up to 1.4 seconds. During that time the keyboard ignores requests and can even lock up its lighting interface. kovarctl protects the keyboard in four ways:
97
+
98
+ - It reads the current state first and skips writes that change nothing.
99
+ - It waits until the keyboard is idle before sending anything, including across separate kovarctl calls.
100
+ - It refuses more than 12 flash writes per minute unless you pass `--force`.
101
+ - It refuses to run while another program, such as OpenRGB, has the keyboard open.
102
+
103
+ For colors that change often, use `live`. Only switching into live mode is a flash write; after that, colors can change as often as you like.
104
+
105
+ The blue LED between Esc and F1 cannot be controlled.
106
+
107
+ ## Development
108
+
109
+ Install from a checkout of the repository and run the tests:
110
+
111
+ ```sh
112
+ pip install -e . pytest
113
+ python3 -m pytest
114
+ ```
115
+
116
+ ## License
117
+
118
+ MIT, see [LICENSE](https://github.com/lkiesow/kovarctl/blob/main/LICENSE).
119
+
120
+ ## Releasing
121
+
122
+ 1. Set the new version in `pyproject.toml`, commit and tag it:
123
+
124
+ ```sh
125
+ git commit -am 'Release 0.2.0'
126
+ git tag v0.2.0
127
+ ```
128
+
129
+ 2. Build the packages and check them, in a virtual environment:
130
+
131
+ ```sh
132
+ rm -rf dist/
133
+ python3 -m build
134
+ twine check --strict dist/*
135
+ ```
136
+
137
+ 3. Upload to [PyPI](https://pypi.org/project/kovarctl/) and push the tag:
138
+
139
+ ```sh
140
+ twine upload dist/*
141
+ git push origin main v0.2.0
142
+ ```
@@ -0,0 +1,122 @@
1
+ # kovarctl
2
+
3
+ Command line tool for the lighting of KOVAR keyboards (ROYUAN YC500 firmware, USB ID `3151:4010`) on Linux.
4
+
5
+ Supported models, identified by the firmware model ID:
6
+
7
+ | ID | Model | Tested |
8
+ |-----|-----------------------------|--------|
9
+ | 738 | KOVAR | yes |
10
+ | 723 | KOVAR Wireless (USB cable) | yes |
11
+ | 737 | KOVAR TKL | no |
12
+ | 736 | KOVAR 60 | no |
13
+
14
+ The 2.4 GHz dongle (`3151:4011`) is not supported, because it uses a different protocol. Connect the keyboard with a USB cable instead.
15
+
16
+ ## Installation
17
+
18
+ ```sh
19
+ pipx install kovarctl
20
+ ```
21
+
22
+ `pip install --user kovarctl` and `uv tool install kovarctl` work as well.
23
+
24
+ The only dependency is [click](https://click.palletsprojects.com/). Your user needs access to the keyboard's `/dev/hidraw*` nodes. Desktop sessions usually grant it, and the OpenRGB udev rules do too.
25
+
26
+ ## Usage
27
+
28
+ ```sh
29
+ kovarctl list # connected keyboards
30
+ kovarctl info # model, firmware, current lighting
31
+ kovarctl effects # effects and their options
32
+ kovarctl mode wave --direction left --color 00ffff
33
+ kovarctl mode breathing --speed 3 # options not given stay as they are
34
+ kovarctl mode static --rainbow
35
+ kovarctl off
36
+ kovarctl side breathing --color red # side light
37
+ kovarctl live ff8000 # one color for all keys, no flash write
38
+ kovarctl live --fade 30 # rainbow fade for 30 s
39
+ some-program | kovarctl live --stdin # one color per line
40
+ kovarctl keys # key names
41
+ kovarctl custom set escape=red w=green --activate
42
+ kovarctl custom set all=000040
43
+ kovarctl custom save picture.json
44
+ kovarctl custom load picture.json --activate
45
+ kovarctl recover # if the keyboard stopped answering
46
+ ```
47
+
48
+ Use `--dry-run` to see what would be written, `-v` to report flash writes, and `--device` or `--id` to choose a keyboard when several are connected.
49
+
50
+ ## Shell completion
51
+
52
+ kovarctl can complete commands, effect names and option values such as `--direction`. This needs the installed `kovarctl` command; it does not work with `python3 -m kovarctl`.
53
+
54
+ **Bash** (version 4.4 or newer), add to `~/.bashrc`:
55
+
56
+ ```sh
57
+ eval "$(_KOVARCTL_COMPLETE=bash_source kovarctl)"
58
+ ```
59
+
60
+ **Zsh**, add to `~/.zshrc` after `compinit` has run (frameworks like Oh My Zsh run it for you):
61
+
62
+ ```sh
63
+ eval "$(_KOVARCTL_COMPLETE=zsh_source kovarctl)"
64
+ ```
65
+
66
+ **Fish**, add to `~/.config/fish/config.fish`:
67
+
68
+ ```sh
69
+ _KOVARCTL_COMPLETE=fish_source kovarctl | source
70
+ ```
71
+
72
+ Open a new shell afterwards. The completion is generated each time a shell starts (about 30 ms), so it always matches the installed version.
73
+
74
+ ## Keyboard flash
75
+
76
+ The keyboard stores effect settings, the side light and the custom picture in its flash memory. Each write keeps the firmware busy for up to 1.4 seconds. During that time the keyboard ignores requests and can even lock up its lighting interface. kovarctl protects the keyboard in four ways:
77
+
78
+ - It reads the current state first and skips writes that change nothing.
79
+ - It waits until the keyboard is idle before sending anything, including across separate kovarctl calls.
80
+ - It refuses more than 12 flash writes per minute unless you pass `--force`.
81
+ - It refuses to run while another program, such as OpenRGB, has the keyboard open.
82
+
83
+ For colors that change often, use `live`. Only switching into live mode is a flash write; after that, colors can change as often as you like.
84
+
85
+ The blue LED between Esc and F1 cannot be controlled.
86
+
87
+ ## Development
88
+
89
+ Install from a checkout of the repository and run the tests:
90
+
91
+ ```sh
92
+ pip install -e . pytest
93
+ python3 -m pytest
94
+ ```
95
+
96
+ ## License
97
+
98
+ MIT, see [LICENSE](https://github.com/lkiesow/kovarctl/blob/main/LICENSE).
99
+
100
+ ## Releasing
101
+
102
+ 1. Set the new version in `pyproject.toml`, commit and tag it:
103
+
104
+ ```sh
105
+ git commit -am 'Release 0.2.0'
106
+ git tag v0.2.0
107
+ ```
108
+
109
+ 2. Build the packages and check them, in a virtual environment:
110
+
111
+ ```sh
112
+ rm -rf dist/
113
+ python3 -m build
114
+ twine check --strict dist/*
115
+ ```
116
+
117
+ 3. Upload to [PyPI](https://pypi.org/project/kovarctl/) and push the tag:
118
+
119
+ ```sh
120
+ twine upload dist/*
121
+ git push origin main v0.2.0
122
+ ```
@@ -0,0 +1 @@
1
+ """Control the lighting of KOVAR keyboards (ROYUAN YC500 firmware)."""
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ main()