Commit d223a08
Yu Leng
feat(powerdisplay): add headless CLI to control monitor settings
Adds PowerToys.PowerDisplay.Cli.exe, a headless command-line front end for the
PowerDisplay module. The CLI is a thin IPC client: it connects to the running
PowerDisplay app over a per-session named pipe and the app performs all hardware
work (DDC/CI and GDI writes) against its live monitor cache, so the CLI itself
needs no elevation or direct hardware access.
Projects:
- PowerDisplay.Contracts - shared request/result/error DTOs, the stable exit/error
codes, the named-pipe name + line framing, and a System.Text.Json source-gen
context (AOT-safe). Single source for setting names, command names, and the
code->exit-code mapping; responses carry an explicit IsError discriminator.
- PowerDisplay.Cli - System.CommandLine front end: parse -> CLI-side validation ->
send the request over the pipe -> render human-readable text -> map the result
to a process exit code. UTF-8 output, --timeout/--quiet, localized strings.
- PowerDisplay (app) - named-pipe server with a cross-integrity ACL so a
non-elevated CLI can reach an elevated app; a request handler that marshals onto
the UI thread; and projectors/executor that turn the monitor model into DTOs and
apply set / apply-profile writes with capability validation.
Commands: list, get, set, capabilities, profiles, apply-profile - with -n/-i
monitor selectors, --setting filter, and --confirm-power-off gating for
display-blanking power states. Exit codes 0-10 are a stable contract
(10 = PowerDisplay not running). Covered by Contracts/Cli/Ipc unit tests.1 parent be4c3a1 commit d223a08
85 files changed
Lines changed: 7727 additions & 13 deletions
File tree
- .github/actions/spell-check
- .pipelines
- installer/PowerToysSetupVNext
- src/modules/powerdisplay
- PowerDisplay.Cli.UnitTests
- PowerDisplay.Cli
- Commands
- Ipc
- Options
- Output
- Properties
- PowerDisplay.Contracts.UnitTests
- PowerDisplay.Contracts
- Requests
- Results
- PowerDisplay.Ipc.UnitTests
- PowerDisplay.Lib
- Drivers
- DDC
- WMI
- Interfaces
- Models
- Services
- PowerDisplay
- Ipc
- PowerDisplayXAML
- ViewModels
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| |||
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
| 436 | + | |
435 | 437 | | |
436 | 438 | | |
437 | 439 | | |
| |||
501 | 503 | | |
502 | 504 | | |
503 | 505 | | |
| 506 | + | |
504 | 507 | | |
505 | 508 | | |
506 | 509 | | |
| |||
673 | 676 | | |
674 | 677 | | |
675 | 678 | | |
| 679 | + | |
676 | 680 | | |
677 | 681 | | |
678 | 682 | | |
| |||
1243 | 1247 | | |
1244 | 1248 | | |
1245 | 1249 | | |
| 1250 | + | |
1246 | 1251 | | |
1247 | 1252 | | |
1248 | 1253 | | |
| |||
1305 | 1310 | | |
1306 | 1311 | | |
1307 | 1312 | | |
| 1313 | + | |
1308 | 1314 | | |
1309 | 1315 | | |
1310 | 1316 | | |
| |||
1542 | 1548 | | |
1543 | 1549 | | |
1544 | 1550 | | |
| 1551 | + | |
1545 | 1552 | | |
1546 | 1553 | | |
1547 | 1554 | | |
| |||
1555 | 1562 | | |
1556 | 1563 | | |
1557 | 1564 | | |
| 1565 | + | |
1558 | 1566 | | |
1559 | 1567 | | |
1560 | 1568 | | |
| |||
1949 | 1957 | | |
1950 | 1958 | | |
1951 | 1959 | | |
| 1960 | + | |
1952 | 1961 | | |
1953 | 1962 | | |
1954 | 1963 | | |
| |||
1961 | 1970 | | |
1962 | 1971 | | |
1963 | 1972 | | |
| 1973 | + | |
1964 | 1974 | | |
1965 | 1975 | | |
1966 | 1976 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
725 | 729 | | |
726 | 730 | | |
727 | 731 | | |
| |||
730 | 734 | | |
731 | 735 | | |
732 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
733 | 741 | | |
734 | 742 | | |
735 | 743 | | |
736 | 744 | | |
737 | 745 | | |
738 | 746 | | |
739 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
740 | 760 | | |
741 | 761 | | |
742 | 762 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
370 | 376 | | |
371 | 377 | | |
372 | 378 | | |
| |||
Lines changed: 106 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments