mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-25 04:34:13 +01:00
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Introduce a new PowerToys' module PowerDisplay to let user can control their monitor settings without touching monitor's button. Support feature list: Common: 1. Profiles support 2. Integration with LightSwitch (auto switch profile when theme change) 3. TrayIcon 4. Save and restore settings when startup 5. Shortcut 6. Rotation 7. GPO support 8. Auto re-discovery monitor when plugging and unplugging monitors. 9. Identify Monitors 10. Quick profile switch Especially for DDC/CI monitor: 1. Brightness 2. Contrast 3. Volume 4. Color temperature (preset profile) 5. Input source 6. Power State (poweroff) Design doc: https://github.com/microsoft/PowerToys/blob/yuleng/display/pr/3/doc/devdocs/modules/powerdisplay/design.md AOT compatibility: I designed this module for AOT from the start, so I'm pretty sure at least 95% of it is AOT compatible. But unfortunately, PowerToys still have a AOT blocker to block this module publish with AOT. Currently PowerToys will check the .net file version (file version not lib version) to avoid crash. So, all modules should reference Common.UI or add UseWPF to avoid overwrite the .net file with different version (which may cause crash). Todo: - [ ] BugBash - [ ] Icon - [ ] IdentifyWindow UI improvement Demo Main UI: <img width="546" height="671" alt="image" src="https://github.com/user-attachments/assets/b0ad9ac5-8000-4365-a192-ab8c2d66d4f1" /> Input Source: <img width="536" height="674" alt="image" src="https://github.com/user-attachments/assets/80f9ccd7-4f8c-4201-b177-cc86c5bcc9e3" /> Settings UI: <img width="1581" height="1191" alt="image" src="https://github.com/user-attachments/assets/6a82e4bb-8f96-4f28-abf9-d7c45e1c8ef7" /> <img width="1525" height="1146" alt="image" src="https://github.com/user-attachments/assets/aae81e65-08fd-453a-bf52-02a74f2fdea0" /> Closes: #42942 #42678 #41117 #38109 #35564 #34932 #28500 #1052 #18149 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #1052 - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [x] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --------- Co-authored-by: Yu Leng <yuleng@microsoft.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: moooyo <lengyuchn@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
292 lines
7.4 KiB
Plaintext
292 lines
7.4 KiB
Plaintext
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
|
|
|
|
# marker to ignore all code on line
|
|
^.*/\* #no-spell-check-line \*/.*$
|
|
# marker for ignoring a comment to the end of the line
|
|
// #no-spell-check.*$
|
|
|
|
# Gaelic
|
|
Gàidhlig
|
|
|
|
Ov_erwrite
|
|
|
|
# languageHashTable
|
|
"\w+(?:-\w+|)"\s+=\s+@\(".*"\)
|
|
|
|
# Regular expression with `\b`
|
|
\\b(?=[a-z]\S*\{)
|
|
|
|
# long lorem
|
|
L"Lorem.*"
|
|
|
|
# tabs in c#
|
|
\$"\\t
|
|
|
|
# Hexadecimal character pattern in code
|
|
\\x[0-9a-fA-F]{4}
|
|
|
|
fontFamily": ".*"
|
|
|
|
D[23]D(?=[A-Z][a-z])
|
|
(?<=[a-z])3D(?=[A-Z])
|
|
|
|
\.monitorId = \{ .*\}
|
|
|
|
json::value\(L"\S+"
|
|
|
|
# windows line breaks in strings
|
|
\\r\\n(?=[A-Za-z])
|
|
|
|
# power shell gallery website
|
|
\bpowershellgallery.com/[-_a-zA-Z0-9()=./%]*
|
|
|
|
# uuid: (or CompGUIDPrefix)
|
|
L?(["']|[-<({>]|\b)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{10,12}(?:\g{-1}|[<})>])
|
|
|
|
(?:L"[abAB]+", ){3}L"[abAB]+"
|
|
|
|
\. (?: @[-A-Za-z\d]+\b(?!\.[A-Z]),?)+
|
|
|
|
auto deviceId = L".*"
|
|
deviceId(?:\.id|) = L".*"
|
|
|
|
StringComparer.OrdinalIgnoreCase\) \{.*\}
|
|
|
|
# namespaces
|
|
\b[a-z]+::
|
|
|
|
"Author": ".+"
|
|
|
|
(?:Include|Link)=".*?"
|
|
|
|
# You could ignore `xmlns`, but it's probably better to enforce rules about them...
|
|
#\s(?:xmlns:[a-z]+(?:[A-Z][a-z]+|)=|[a-z]+(?:[A-Z][a-z]+):(?=[a-z]+=))
|
|
|
|
# UnitTests
|
|
\[DataRow\(.*\)\]
|
|
|
|
# AdditionalDependencies
|
|
<AdditionalDependencies>.*<
|
|
|
|
# the last line of mimetype="application/x-microsoft.net.object.bytearray.base64" things in .resx files
|
|
^\s*[-a-zA-Z=;:/0-9+]*[-a-zA-Z;:/0-9+][-a-zA-Z=;:/0-9+]*=$
|
|
|
|
# Automatically suggested patterns
|
|
|
|
# hit-count: 5402 file-count: 1339
|
|
# IServiceProvider / isAThing
|
|
(?:(?:\b|_|(?<=[a-z]))[IT]|(?:\b|_)(?:nsI|isA))(?=(?:[A-Z][a-z]{2,})+(?:[A-Z\d]|\b))
|
|
|
|
# hit-count: 2073 file-count: 842
|
|
# #includes
|
|
^\s*#include\s*(?:<.*?>|".*?")
|
|
|
|
# hit-count: 1639 file-count: 855
|
|
# C# includes
|
|
^\s*using [^;]+;
|
|
|
|
# hit-count: 1491 file-count: 693
|
|
# microsoft
|
|
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|docs|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%]*
|
|
|
|
# hit-count: 398 file-count: 133
|
|
# hex digits including css/html color classes:
|
|
(?:[\\0][xX]|\\u\{?|[uU]\+|#x?|%23|&H)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b
|
|
|
|
# hit-count: 339 file-count: 146
|
|
# hex runs
|
|
\b[0-9a-fA-F]{16,}\b
|
|
|
|
# hit-count: 253 file-count: 100
|
|
# GitHub SHAs (markdown)
|
|
(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|)
|
|
|
|
# hit-count: 241 file-count: 37
|
|
# version suffix <word>v#
|
|
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
|
|
|
|
# hit-count: 141 file-count: 6
|
|
# Contributor / Project
|
|
\[[^\]\s]+\]\(https://github\.com/[^)]+\)(?: -(?: [A-Z]\S+)+|)|\[[^\]]+\]\(https://github\.com/(?:[^/\s"]+/?){1,2}\)
|
|
|
|
https://github.com/(?:[-\w]+/?){1,2}
|
|
|
|
# hit-count: 131 file-count: 125
|
|
# Repeated letters
|
|
\b([a-z])\g{-1}{2,}\b
|
|
|
|
# hit-count: 99 file-count: 97
|
|
# w3
|
|
\bw3\.org/[-0-9a-zA-Z/#.]+
|
|
|
|
# hit-count: 59 file-count: 11
|
|
# Markdown anchor links
|
|
\(#\S*?[a-zA-Z]\S*?\)
|
|
|
|
# hit-count: 29 file-count: 23
|
|
# stackexchange -- https://stackexchange.com/feeds/sites
|
|
\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/)
|
|
|
|
# hit-count: 24 file-count: 11
|
|
# Library prefix
|
|
# e.g., `lib`+`archive`, `lib`+`raw`, `lib`+`unwind`
|
|
# (ignores some words that happen to start with `lib`)
|
|
(?:\b|_)[Ll]ib(?:re(?=office)|)(?!era[lt]|ero|erty|rar(?:i(?:an|es)|y))(?=[a-z])
|
|
|
|
# hit-count: 20 file-count: 2
|
|
# Intel intrinsics
|
|
_mm\d*_(?!dd)\w+
|
|
|
|
# hit-count: 15 file-count: 8
|
|
# Wikipedia
|
|
\ben\.wikipedia\.org/wiki/[-\w%.#]+
|
|
|
|
# hit-count: 14 file-count: 10
|
|
# vs devops
|
|
\bvisualstudio.com(?::443|)/[-\w/?=%&.]*
|
|
|
|
# hit-count: 8 file-count: 2
|
|
# copyright
|
|
Copyright (?:\([Cc]\)|)(?:[-\d, ]|and)+(?: [A-Z][a-z]+ [A-Z][a-z]+,?)+
|
|
|
|
# hit-count: 8 file-count: 1
|
|
# css fonts
|
|
\bfont(?:-family|):[^;}]+
|
|
|
|
aka\.ms/[a-zA-Z0-9]+
|
|
|
|
# hit-count: 8 file-count: 1
|
|
# kubernetes crd patterns
|
|
^\s*pattern: .*$
|
|
|
|
# hit-count: 5 file-count: 3
|
|
# URL escaped characters
|
|
%[0-9A-F][A-F](?=[A-Za-z])
|
|
|
|
# hit-count: 3 file-count: 3
|
|
# githubusercontent
|
|
/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
|
|
|
|
# hit-count: 2 file-count: 2
|
|
# medium
|
|
\bmedium\.com/@?[^/\s"]+/[-\w:/*.]+
|
|
|
|
# hit-count: 2 file-count: 1
|
|
# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there
|
|
# YouTube url
|
|
\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]*
|
|
|
|
# hit-count: 2 file-count: 1
|
|
# GitHub actions
|
|
\buses:\s+[-\w.]+/[-\w./]+@[-\w.]+
|
|
|
|
# hit-count: 1 file-count: 1
|
|
# curl arguments
|
|
\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)*
|
|
|
|
# hit-count: 1 file-count: 1
|
|
# tar arguments
|
|
\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+
|
|
|
|
# #pragma lib
|
|
^\s*#pragma comment\(lib, ".*?"\)
|
|
|
|
# UnitTests
|
|
\[DataRow\(.*\)\]
|
|
|
|
# AdditionalDependencies
|
|
<AdditionalDependencies>.*<
|
|
|
|
# the last line of mimetype="application/x-microsoft.net.object.bytearray.base64" things in .resx files
|
|
^\s*[-a-zA-Z=;:/0-9+]*[-a-zA-Z;:/0-9+][-a-zA-Z=;:/0-9+]*=$
|
|
|
|
RegExp\(@?([`'"]).*?\g{-1}\)|(?:escapes|regEx):\s*(?:/.*/|([`'"]).*?\g{-1})|return/.*?/
|
|
|
|
# Questionably acceptable forms of `in to`
|
|
# Personally, I prefer `log into`, but people object
|
|
# https://www.tprteaching.com/log-into-log-in-to-login/
|
|
\b(?:(?:[Ll]og(?:g(?=[a-z])|)|[Ss]ign)(?:ed|ing)?) in to\b
|
|
|
|
# to opt in
|
|
\bto opt in\b
|
|
|
|
# pass(ed|ing) in
|
|
\bpass(?:ed|ing) in\b
|
|
|
|
# acceptable duplicates
|
|
# ls directory listings
|
|
[-bcdlpsw](?:[-r][-w][-SsTtx]){3}[\.+*]?\s+\d+\s+\S+\s+\S+\s+[.\d]+(?:[KMGT]|)\s+
|
|
# mount
|
|
\bmount\s+-t\s+(\w+)\s+\g{-1}\b
|
|
# C types and repeated CSS values
|
|
\s(auto|buffalo|center|div|inherit|long|LONG|none|normal|solid|thin|transparent|very)(?:\s\g{-1})+\s
|
|
# C enum and struct
|
|
\b(?:enum|struct)\s+(\w+)\s+\g{-1}\b
|
|
# go templates
|
|
\s(\w+)\s+\g{-1}\s+\`(?:graphql|inject|json|yaml):
|
|
# doxygen / javadoc / .net
|
|
(?:[\\@](?:brief|defgroup|groupname|link|t?param|return|retval)|(?:public|private|\[Parameter(?:\(.+\)|)\])(?:\s+(?:static|override|readonly|required|virtual))*)(?:\s+\{\w+\}|)\s+(\w+)\s+\g{-1}\s
|
|
|
|
# macOS file path
|
|
(?:Contents\W+|(?!iOS)/)MacOS\b
|
|
|
|
# Python package registry has incorrect spelling for macOS / Mac OS X
|
|
"Operating System :: MacOS :: MacOS X"
|
|
|
|
# "company" in Germany
|
|
\bGmbH\b
|
|
|
|
# IntelliJ
|
|
\bIntelliJ\b
|
|
|
|
# Commit message -- Signed-off-by and friends
|
|
^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$
|
|
|
|
# Autogenerated revert commit message
|
|
^This reverts commit [0-9a-f]{40}\.$
|
|
|
|
# Compile flag added to Cpp.Build.props
|
|
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
|
|
|
|
# ignore long runs of a single character:
|
|
\b([A-Za-z])\g{-1}{3,}\b
|
|
|
|
# hit-count: 1 file-count: 1
|
|
# Amazon
|
|
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)
|
|
|
|
# hit-count: 3 file-count: 3
|
|
# imgur
|
|
\bimgur\.com/[^.]+
|
|
|
|
# Process Process (typename varname)
|
|
Process Process
|
|
|
|
# ZoomIt menu items with accelerator keys
|
|
E&xit
|
|
St&yle
|
|
|
|
# This matches a relative clause where the relative pronoun "that" is omitted.
|
|
# Example: "Gets or sets the window the TitleBar should configure."
|
|
\bthe\s+\w+\s+the\b
|
|
|
|
# Usernames with numbers
|
|
# 0x6f677548 is user name but user folder causes a flag
|
|
\bx6f677548\b
|
|
|
|
# Windows API constants and hardware interface terms
|
|
\bCOINIT[_A-Z]*\b
|
|
\bEOAC[_A-Z]*\b
|
|
\b(?:RPC_C_AUTHN_)?WINNT\b
|
|
\bUPDATEREGISTRY\b
|
|
\b(?:CDS_)?UPDATEREGISTRY\b
|
|
|
|
# Display interface terms (HDMI, DVI, DisplayPort)
|
|
\b(?:HDMI|DVI|DisplayPort)(?:-\d+)?\b
|
|
|
|
# 2D Region struct names
|
|
\bDisplayConfig2?D?Region\b
|
|
|
|
# Microsoft Store URLs and product IDs
|
|
ms-windows-store://\S+
|