Skip to content

Commit

Permalink
Update setup.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
starchyunderscore authored Sep 28, 2023
1 parent 8048e94 commit 85f67e8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions current/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -587,19 +587,20 @@ public class PInvoke {
} catch {
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type "DWord" -Value 1
}
Write-Output "Changes will apply the next time you log in."
}
2 { # Disable
try {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type "DWord" -Value 0
} catch {
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type "DWord" -Value 0
}
Write-Output "Changes will apply the next time you log in."
}
3 { # Test
Show-Notification "Test notification" "Lorem ipsum dolor sit amet."
}
}
Write-Output "Changes will apply the next time you log in."
}
}
} until ($Themer -notmatch "\S")
Expand Down Expand Up @@ -852,31 +853,33 @@ public class PInvoke {
}
}
4 { # Find Cursor

$CursorFind = $Host.UI.PromptForChoice("Find cursor", "", @("&Cancel", "&Enable", "&Disable"), 0)
Write-Output "I reccomend installing powertoys instead, as it's cursor locate feature looks better"
$CursorFind = $Host.UI.PromptForChoice("Find cursor", "", @("&Cancel", "&Enable", "&Disable"), 0)
switch ($CursorFind) {
0 { # Cancel
Write-Output "`nCancled"
}
1 { # Enable
$Off = $true
$Off = $false
$Bit = 0x40
$B = 1
$UserPreferencesMask = (Get-ItemProperty "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask").UserPreferencesMask
If ($UserPreferencesMask -eq $null){Write-Error "Cannot find HKCU:\Control Panel\Desktop: UserPreferencesMask"}
$NewMask = $UserPreferencesMask
if ($Off) {$NewMask[$B] = $NewMask[$B] -band -bnot $Bit} else {$NewMask[$B] = $NewMask[$B] -bor $Bit}
if ($NewMask -ne $UserPreferencesMask) {Set-ItemProperty "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Value $NewMask}
Write-Output "Changes will apply next time you log in"
}
2 { # Disable
$Off = $false
$Off = $true
$Bit = 0x40
$B = 1
$UserPreferencesMask = (Get-ItemProperty "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask").UserPreferencesMask
If ($UserPreferencesMask -eq $null){Write-Error "Cannot find HKCU:\Control Panel\Desktop: UserPreferencesMask"}
$NewMask = $UserPreferencesMask
if ($Off) {$NewMask[$B] = $NewMask[$B] -band -bnot $Bit} else {$NewMask[$B] = $NewMask[$B] -bor $Bit}
if ($NewMask -ne $UserPreferencesMask) {Set-ItemProperty "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Value $NewMask}
Write-Output "Changes will apply next time you log in"
}
}
}
Expand Down

0 comments on commit 85f67e8

Please sign in to comment.