Skip to content

Commit

Permalink
docs: add note
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitid committed Aug 11, 2024
1 parent d88ec12 commit f897063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ There's also https://gobyexample.com/embed-directive
https://pkg.go.dev/golang.design/x/hotkey
https://github.com/micmonay/keybd_event


## Display name to device ID mapping

[This](https://github.com/posthumz/DisplayDevices) from [here](https://www.reddit.com/r/PowerShell/comments/19e7das/getting_display_id_for_a_display_device/)
Expand All @@ -25,9 +24,13 @@ Other packages to try:
"github.com/hillu/go-ntdll"
"github.com/rodrigocfd/windigo"
"github.com/iamacarpet/go-win64api"
"github.com/Microsoft/go-winio"
"github.com/dblohm7/wingoes"
"github.com/gonutz/w32" < preferred, acts like win32 python package
```

Code to reference:

- https://github.com/PoeBlu/hardentools/blob/master/autorun.go
- https://github.com/linexjlin/inputGPT
- https://github.com/st0le/winrec
Expand Down Expand Up @@ -87,7 +90,7 @@ Get-WmiObject WmiMonitorID -Namespace root\wmi | Where-Object { $_.InstanceName
Get-WmiObject -Query "SELECT InstanceName FROM WmiMonitorID" -Namespace root\wmi
```

Prefer option B as it doesn't capitalizes `14db058f` part of `DISPLAY\SHP1523\5&14db058f&2&UID512_0` and thus can directly be supplied to monitorian (after stripping _0 of course).
Prefer option B as it doesn't capitalizes `14db058f` part of `DISPLAY\SHP1523\5&14db058f&2&UID512_0` and thus can directly be supplied to monitorian (after stripping \_0 of course).

## Softwares to control brightness

Expand Down Expand Up @@ -134,4 +137,4 @@ func decodeWMIString(s string) string {
## Rest

https://github.com/nyaosorg/go-windows-su sudo/administrator
https://claude.ai/chat/46f64a64-2c6d-41ec-b77a-6f079bcd5662 get theme and theme change detection
https://claude.ai/chat/46f64a64-2c6d-41ec-b77a-6f079bcd5662 get theme and theme change detection
1 change: 1 addition & 0 deletions wmi-query_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (m WMIMonitor) getBrightness() (int, error) {
// I wanted to use this but I couldn't figure it out
// https://github.com/StackExchange/wmi/pull/45#issuecomment-590396746
func (m WMIMonitor) setBrightness(value int) {
// TODO wmic is deprecated, see https://stackoverflow.com/a/56350464
cmd := exec.Command("wmic", `/NAMESPACE:\\root\wmi`, "PATH", "WmiMonitorBrightnessMethods",
"WHERE", fmt.Sprintf("Active=TRUE AND InstanceName='%s'", strings.ReplaceAll(m.getInstanceName(), `\`, `\\`)),
"CALL", "WmiSetBrightness", fmt.Sprintf("Brightness=%d", value), "Timeout=0")
Expand Down

0 comments on commit f897063

Please sign in to comment.