xtmonctl 1.0.4

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 (3) hide show
  1. package/README.md +298 -0
  2. package/bin/xtmonctl +0 -0
  3. package/package.json +30 -0
package/README.md ADDED
@@ -0,0 +1,298 @@
1
+ # xtmonctl
2
+
3
+ `xtmonctl` is a Linux command-line and terminal UI tool for controlling the brightness of external monitors through `ddcutil` and DDC/CI.
4
+
5
+ It is aimed at people who live in the terminal and want a straightforward way to manage monitor brightness without opening a desktop settings panel every time. The most natural audience is Arch Linux, Debian, Ubuntu, Fedora, and similar desktop users who already install command-line tools, use external monitors, and are comfortable with package-manager setup steps when hardware access is involved.
6
+
7
+ ## Screenshot
8
+
9
+ ![xtmonctl TUI](assets/screenshots/xtmonctl-tui.png)
10
+
11
+ ## What It Is Good For
12
+
13
+ - External monitor brightness control from the terminal
14
+ - Keyboard-driven brightness adjustments in a TUI
15
+ - Shell scripting and automation with plain text or JSON output
16
+ - Managing multi-monitor setups with friendly aliases
17
+ - Linux desktop users who want a small native binary instead of a Python toolchain
18
+
19
+ ## What It Does Not Guarantee
20
+
21
+ `xtmonctl` does not work with every screen on every Linux system.
22
+
23
+ It depends on:
24
+
25
+ - Linux
26
+ - `ddcutil`
27
+ - a monitor that supports DDC/CI
28
+ - a cable and GPU path that actually passes DDC/CI traffic
29
+ - permission to access I2C devices
30
+
31
+ Internal laptop panels usually do not work through DDC/CI. Some adapters, docks, KVMs, HDMI splitters, and unusual GPU drivers can also break DDC/CI support even when the monitor itself is capable.
32
+
33
+ ## Support Matrix
34
+
35
+ Officially targeted environment:
36
+
37
+ - OS: Linux
38
+ - Monitor type: external monitors with DDC/CI support
39
+ - Interface: HDMI, DisplayPort, DVI, VGA where DDC/CI is exposed correctly
40
+ - Shell use: supported
41
+ - TUI use: supported
42
+
43
+ Best-supported distributions:
44
+
45
+ - Arch Linux and Arch-based distributions
46
+ - Debian and Ubuntu
47
+ - Fedora
48
+
49
+ Not currently targeted:
50
+
51
+ - macOS
52
+ - Windows
53
+ - internal laptop brightness control
54
+
55
+ ## Features
56
+
57
+ - Interactive TUI
58
+ - Slash-command palette inside the TUI
59
+ - Scriptable CLI
60
+ - Multi-monitor support
61
+ - Honest percentage reporting when the monitor max is not `100`
62
+ - Alias-aware monitor lookup
63
+ - YAML configuration
64
+ - JSON output for scripting
65
+ - In-app theme switching
66
+ - Release binaries for direct installation
67
+
68
+ ## Installation
69
+
70
+ ### Option 1: Install the latest release binary
71
+
72
+ This is the simplest way to install it like a normal terminal program.
73
+
74
+ ```bash
75
+ curl -fsSL https://github.com/ThorOdinson246/xmonctl-rs/releases/latest/download/xtmonctl-x86_64-unknown-linux-gnu.tar.gz -o xtmonctl.tar.gz
76
+ tar -xzf xtmonctl.tar.gz
77
+ install -Dm755 xtmonctl "$HOME/.local/bin/xtmonctl"
78
+ ```
79
+
80
+ Make sure `$HOME/.local/bin` is on your `PATH`.
81
+
82
+ ### Option 2: Use the interactive installer
83
+
84
+ ```bash
85
+ ./scripts/install.sh
86
+ ./scripts/install.sh --from-release
87
+ ```
88
+
89
+ `--from-release` prefers the latest GitHub release binary. Without it, the script installs from the local source tree with Cargo.
90
+
91
+ ### Option 3: Install from source with Cargo
92
+
93
+ ```bash
94
+ cargo install --path .
95
+ ```
96
+
97
+ ## Distribution-Specific Setup
98
+
99
+ ### Arch Linux
100
+
101
+ Install system requirements:
102
+
103
+ ```bash
104
+ sudo pacman -S ddcutil rustup
105
+ rustup default stable
106
+ rustup component add rustfmt clippy
107
+ ```
108
+
109
+ Build and install locally:
110
+
111
+ ```bash
112
+ cargo install --path .
113
+ ```
114
+
115
+ There is also an Arch packaging helper at [packaging/arch/PKGBUILD](</mnt/686c9079-54d3-48e6-b3f8-474d3f6d2175/OSource/xtmonctl-rs/packaging/arch/PKGBUILD>) if you want to turn it into a package with `makepkg`.
116
+
117
+ ### Debian and Ubuntu
118
+
119
+ Install system requirements:
120
+
121
+ ```bash
122
+ sudo apt update
123
+ sudo apt install -y ddcutil curl build-essential pkg-config dpkg-dev
124
+ ```
125
+
126
+ Install from release:
127
+
128
+ ```bash
129
+ ./scripts/install.sh --from-release
130
+ ```
131
+
132
+ Build a local `.deb` package:
133
+
134
+ ```bash
135
+ ./packaging/debian/build-deb.sh
136
+ sudo apt install ./xtmonctl_0.1.1_amd64.deb
137
+ ```
138
+
139
+ ### Fedora
140
+
141
+ Install system requirements:
142
+
143
+ ```bash
144
+ sudo dnf install -y ddcutil rust cargo
145
+ ```
146
+
147
+ Then install from source:
148
+
149
+ ```bash
150
+ cargo install --path .
151
+ ```
152
+
153
+ ## Required System Access
154
+
155
+ For non-root use, your system usually needs:
156
+
157
+ - the `i2c-dev` kernel module
158
+ - udev rules allowing access to `/dev/i2c-*`
159
+ - a session restart after group or permission changes
160
+
161
+ The installer script helps configure these, but the exact setup depends on your distribution.
162
+
163
+ ## Usage
164
+
165
+ ### Start the TUI
166
+
167
+ ```bash
168
+ xtmonctl
169
+ ```
170
+
171
+ ### TUI Highlights
172
+
173
+ - `j` / `k` or arrow keys move between monitors
174
+ - `h` / `l` adjust brightness by the configured step size
175
+ - `H` / `L` use the larger configured step size
176
+ - `0-9` apply preset brightness levels
177
+ - `t` cycles themes
178
+ - `r` refreshes monitor detection and brightness reads
179
+ - `Tab` opens the command palette
180
+ - `/status`, `/controls`, `/presets`, `/help`, `/theme`, `/hide` are available in the palette
181
+ - Short aliases like `/s`, `/c`, `/p`, `/h`, `/t`, and `/x` work too
182
+
183
+ ### CLI Commands
184
+
185
+ ```bash
186
+ xtmonctl list
187
+ xtmonctl list --json
188
+ xtmonctl get 1
189
+ xtmonctl get "Main Monitor"
190
+ xtmonctl set 1 70
191
+ xtmonctl set 1 +10
192
+ xtmonctl all 40
193
+ xtmonctl alias list
194
+ xtmonctl alias set 1 "Main Monitor"
195
+ xtmonctl alias clear 1
196
+ xtmonctl config path
197
+ ```
198
+
199
+ ### JSON Output
200
+
201
+ Examples:
202
+
203
+ ```bash
204
+ xtmonctl list --json
205
+ xtmonctl get 1 --json
206
+ xtmonctl alias list --json
207
+ ```
208
+
209
+ This is useful when integrating `xtmonctl` into shell scripts, window manager hooks, or custom desktop widgets.
210
+
211
+ ## Configuration
212
+
213
+ Default config path:
214
+
215
+ ```text
216
+ ~/.config/xtmonctl/config.yaml
217
+ ```
218
+
219
+ Override it with:
220
+
221
+ ```bash
222
+ xtmonctl --config /path/to/config.yaml list
223
+ ```
224
+
225
+ Example config:
226
+
227
+ ```yaml
228
+ monitors:
229
+ i2c-4:
230
+ alias: Main Monitor
231
+ last_brightness_percent: 70
232
+ default_step_percent: 5
233
+ large_step_percent: 10
234
+ detection_timeout_secs: 15
235
+ command_timeout_secs: 5
236
+ ```
237
+
238
+ ## Release and Packaging
239
+
240
+ ### GitHub Releases
241
+
242
+ Pushing a tag like `v0.1.1` triggers the release workflow, which uploads:
243
+
244
+ - `xtmonctl-x86_64-unknown-linux-gnu.tar.gz`
245
+
246
+ ### Arch Packaging
247
+
248
+ Use:
249
+
250
+ ```bash
251
+ cd packaging/arch
252
+ makepkg -si
253
+ ```
254
+
255
+ ### Debian Packaging
256
+
257
+ Use:
258
+
259
+ ```bash
260
+ ./packaging/debian/build-deb.sh
261
+ sudo apt install ./xtmonctl_0.1.1_amd64.deb
262
+ ```
263
+
264
+ ## Troubleshooting
265
+
266
+ ### No monitors detected
267
+
268
+ Check:
269
+
270
+ - that the monitor supports DDC/CI
271
+ - that DDC/CI is enabled in the monitor menu
272
+ - that your cable or dock passes DDC/CI
273
+ - that `ddcutil detect` works directly
274
+
275
+ ### Permission denied
276
+
277
+ You probably need I2C access configured for your user. Re-run:
278
+
279
+ ```bash
280
+ ./scripts/install.sh
281
+ ```
282
+
283
+ ### The monitor is listed but brightness reads fail
284
+
285
+ That usually means the monitor is visible but DDC/CI communication is unreliable on the current cable, dock, GPU output, or adapter path.
286
+
287
+ ## Development
288
+
289
+ ```bash
290
+ cargo fmt
291
+ cargo clippy --all-targets --all-features -- -D warnings
292
+ cargo test
293
+ cargo build --release
294
+ ```
295
+
296
+ ## Current Status
297
+
298
+ `xtmonctl` is usable now for Linux users with supported external monitors, but it should still be treated as an early-stage hardware utility rather than a guaranteed universal monitor tool. If your setup is a common Linux desktop with standard HDMI or DisplayPort external displays, it should be a good fit. If your setup relies on unusual docks, KVMs, laptop internal panels, or proprietary GPU edge cases, expect some trial and error.
package/bin/xtmonctl ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "xtmonctl",
3
+ "version": "1.0.4",
4
+ "description": "External monitor brightness control via ddcutil",
5
+ "bin": {
6
+ "xtmonctl": "bin/xtmonctl"
7
+ },
8
+ "files": [
9
+ "bin/xtmonctl"
10
+ ],
11
+ "os": [
12
+ "linux"
13
+ ],
14
+ "cpu": [
15
+ "x64"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/ThorOdinson246/xmonctl-rs.git"
20
+ },
21
+ "author": "ThorOdinson246",
22
+ "license": "MIT",
23
+ "keywords": [
24
+ "ddcutil",
25
+ "monitor",
26
+ "brightness",
27
+ "linux",
28
+ "tui"
29
+ ]
30
+ }