t1m0thyj / WDD-scripts

PowerShell scripts that add features to WinDynamicDesktop
87 stars 19 forks source link

[Help needed] I am not succeeding changing mouse scheme on windows 11. #32

Closed bigplayer-ai closed 1 year ago

bigplayer-ai commented 1 year ago

I am having some hard time trying to change mouse cursor using PowerShell script on windows 11. I have this application called WDD scripts which have the power of PowerShell scripts depending on the time of the day/ dark or light system OS theme.

I am having hard time writing a script to change mouse cursor using powershell script. this is what I done so far (checked if theme uses light/dark theme). Now the missing part is how to change the mouse cursor.

param (
    [Parameter(Mandatory=$true)][int]$daySegment2,  # 0 = Day, 1 = Night
    [Parameter(Mandatory=$true)][int]$daySegment4,  # -1 = N/A, 0 = Sunrise, 1 = Day, 2 = Sunset, 3 = Night
    [Parameter(Mandatory=$true)][bool]$nightMode,   # True if night mode is enabled
    [Parameter(Mandatory=$false)][string]$imagePath # Path to current wallpaper image
)

$NightValue = If ($nightMode) {1} Else {$daySegment2}
if ( $NightValue -eq 0)
{
    //change mouse cursor to light
}
else
{
    //change mouse cursor to dark
}

I have seen many application that solves this issue like Auto Dark Mode, But no one is sharing how they done it. I am trying to change mouse scheme as shown in the image below: Light mode

and Windows Black scheme when it is dark mode. I tried changing every registry to dark mode in here, the settings is updated but not the cursor itself.

HKEY_CURRENT_USER\Control Panel\Cursors HKEY_CURRENT_USER\Control Panel

bigplayer-ai commented 1 year ago

Done