Since my OP script didnt work properly(it always displayed HDR OFF no matter what), i settled on following script
Code: Select all
# Run dxdiag command and capture the output in dxdiag_output.txt
dxdiag /t "C:\Portable Apps\PortableApps\Rainmeter Portable\dxdiag_output.txt"
# Wait for 6 seconds to ensure dxdiag has finished generating the output file
Start-Sleep -Seconds 6
# Read the dxdiag output file
$dxdiagContent = Get-Content -Path "C:\Portable Apps\PortableApps\Rainmeter Portable\dxdiag_output.txt" -Raw
# Check if "AdvancedColorEnabled" is present in the output
if ($dxdiagContent -match "AdvancedColorEnabled") {
Write-Output "HDR ON"
} else {
Write-Output "HDR OFF"
}
This generates the "dxdiag" file, wait timer is there as generating a file might take a second or two, i just gave it some leeway so the skin shows proper text.
I then created a AutoHotkey script
Code: Select all
#!b:: ; WIN+ALT+B
Run, C:\Portable Apps\PortableApps\Rainmeter Portable\Rainmeter.exe !RefreshApp
return
Hotkey is for toggling HDR in windows 11.
The code in skin is eclectic-tech one, which he kindly helped me with, i just had to use !Set variable in FinishAction as the Measure method didnt work for me. I then added a timer so it refreshes the skin once in a while, but since i have a hotkey its kinda pointless, at windows startup everything is refreshed anyway i believe so correct text would be shown either way.
I posted this for anyone, who would want this info in their skin in the future.
And again, thanks for all the help.