From 38b91ec5d5d3a857ecd300b338acbd6ec6eb2f60 Mon Sep 17 00:00:00 2001 From: Josh <34052455+LucidLuxxx@users.noreply.github.com> Date: Sun, 20 Jul 2025 14:44:34 -0400 Subject: [PATCH] Add files via upload Disable Windows Notifications and Focus Assist --- plugins/DisableNotifications.ps1 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 plugins/DisableNotifications.ps1 diff --git a/plugins/DisableNotifications.ps1 b/plugins/DisableNotifications.ps1 new file mode 100644 index 0000000..919c098 --- /dev/null +++ b/plugins/DisableNotifications.ps1 @@ -0,0 +1,30 @@ +#Requires -RunAsAdministrator + +try { + # Disable Windows notifications by modifying registry settings + Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0 -ErrorAction Stop + + # Disable notifications in the Settings app (Action Center) + Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" -Name "NOC_GLOBAL_SETTING_TOASTS_ENABLED" -Type DWord -Value 0 -ErrorAction Stop + + # Suppress notification banners for all apps + $apps = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\*" -ErrorAction SilentlyContinue + foreach ($app in $apps) { + Set-ItemProperty -Path $app.PSPath -Name "ShowInActionCenter" -Type DWord -Value 0 -ErrorAction SilentlyContinue + Set-ItemProperty -Path $app.PSPath -Name "Enabled" -Type DWord -Value 0 -ErrorAction SilentlyContinue + } + + # Attempt to disable Focus Assist (Quiet Hours), but skip if path doesn't exist + $focusAssistPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.notifications.quiethourssettings\Current" + if (Test-Path $focusAssistPath) { + Set-ItemProperty -Path $focusAssistPath -Name "Data" -Type Binary -Value ([byte[]](0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00)) -ErrorAction Stop + } else { + Write-Host "Focus Assist registry path not found. Skipping Focus Assist configuration." + } + + Write-Host "Windows notifications have been disabled. Please restart your system for changes to take effect." +} +catch { + Write-Host "An error occurred: $_" + Write-Host "Some notification settings may not have been applied." +} \ No newline at end of file