From 03f94296aef0ede7e28bf2fe7456993ff4478d89 Mon Sep 17 00:00:00 2001 From: Derek Cooper Date: Mon, 30 Mar 2026 14:38:41 -0700 Subject: [PATCH] Forced BufferStarted notification to pop up on the screen that is being recorded so the user knows which one to have the application on --- scripts/Show-Notification.ps1 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/Show-Notification.ps1 b/scripts/Show-Notification.ps1 index 33affad..d9a527f 100644 --- a/scripts/Show-Notification.ps1 +++ b/scripts/Show-Notification.ps1 @@ -25,6 +25,7 @@ $ErrorActionPreference = 'Stop' Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName WindowsBase Add-Type -AssemblyName System.Drawing +Add-Type -AssemblyName System.Windows.Forms Add-Type -TypeDefinition @" using System; @@ -54,7 +55,7 @@ if ($Type -eq 'BufferStarted') { @@ -92,7 +93,11 @@ if ($Type -eq 'BufferStarted') { $imgTray.Source = $wpfShield $txtContact.Text = "Questions? Contact IT at $ContactNumber" - $txtBody.Inlines.Add("Your screen is being recorded into a rolling $BufferMinutes-minute replay buffer. Nothing is saved until you request it.`n`nTo save a clip, ") + $txtBody.Inlines.Add("Your screen is being recorded into a rolling $BufferMinutes-minute replay buffer. Nothing is saved until you request it.`n`n") + $bold0 = New-Object System.Windows.Documents.Run('Open the application you want to capture on this screen.') + $bold0.FontWeight = [System.Windows.FontWeights]::Bold + $txtBody.Inlines.Add($bold0) + $txtBody.Inlines.Add("`n`nTo save a clip, ") $bold1 = New-Object System.Windows.Documents.Run('right-click the shield icon') $bold1.FontWeight = [System.Windows.FontWeights]::Bold $txtBody.Inlines.Add($bold1) @@ -107,7 +112,7 @@ if ($Type -eq 'BufferStarted') { @@ -164,4 +169,10 @@ if ($Type -eq 'ReplaySaved') { $btnOK.Content = 'OK' $btnOK.Add_Click({ $window.Close() }.GetNewClosure()) } +# Center on the primary monitor (the one OBS is recording) +$screen = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds +$window.Add_Loaded({ + $window.Left = $screen.Left + ($screen.Width - $window.ActualWidth) / 2 + $window.Top = $screen.Top + ($screen.Height - $window.ActualHeight) / 2 +}.GetNewClosure()) $window.ShowDialog() | Out-Null