File tree Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 88
99$chromePath = ' C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
1010$chromeArguments = ' --new-window --incognito'
11- $cockpitPath = ' C:\Kiosk-Mode\Cockpit.CommunicationSpace.appref-ms'
11+ # if Window not moved (especially on machine start) - try increaing the delay.
12+ $ChromeStartDelay = 3
1213
1314Set-Location $PSScriptRoot
1415. .\HelperFunctions.ps1
1516
16- # Kill all running
17- & taskkill / im chrome* / F
18- & taskkill / im Ciklum.Cockpit.CommunicationSpace* / F
17+ # Kill all running instances
18+ # &taskkill /im chrome* /F
1919
20-
21- Cockpit- Start - MonitorNum 2 # middle top
22-
23- Chrome- Kiosk ' http://dashboard.hubclone.pp.ciklum.com/dashboard/externalRequests' - MonitorNum 4 # left
24- Chrome- Kiosk ' http://dashboard.hubclone.pp.ciklum.com/dashboard/externalProjects' - MonitorNum 1 # middle bottom
25- Chrome- Kiosk ' http://dashboard.hubclone.pp.ciklum.com/dashboard/metrixDashboards' - MonitorNum 3 # right
26-
27-
28- Pause
20+ Chrome- Kiosk ' http://google.com' - MonitorNum 1
21+ Chrome- Kiosk ' http://http://www.bbc.com/' - MonitorNum 2
Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ Add-Type -Path Tomin.Tools.KioskMode.dll
88$WinAPI = [Tomin.Tools.KioskMode.WinApi ]
99$Helpers = [Tomin.Tools.KioskMode.Helper ]
1010
11- # todo: optimize to avoid endless loop;
11+ if (! $ChromeStartDelay ) {$ChromeStartDelay = 3 }
12+ if (! $chromePath ) {$chromePath = ' C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' }
13+ if (! $chromeArguments ) {$chromeArguments = ' --new-window --incognito' }
14+
1215function Wait-ForProcess ($procName , $procTitle )
1316{
1417 $sw = [Diagnostics.Stopwatch ]::StartNew()
@@ -33,15 +36,14 @@ function Chrome-Kiosk($Url, $MonitorNum)
3336{
3437 Write-Output " starting chrome $Url , monitor: $MonitorNum "
3538 Start-Process $chromePath " $chromeArguments $Url "
36- Start-Sleep - Seconds 5
39+ Start-Sleep - Seconds $ChromeStartDelay
3740
3841 $window = (Get-Process - Name chrome | where MainWindowHandle -ne ([IntPtr ]::Zero) | select - First 1 ).MainWindowHandle
3942
4043 $WinAPI ::ShowWindow($window , [Tomin.Tools.KioskMode.Enums.ShowWindowCommands ]::Restore)
4144 $Helpers ::MoveToMonitor($window , $MonitorNum )
4245 $Helpers ::SendKey($window , ' {F11}' )
43- Start-Sleep - Seconds 3
44-
46+ Start-Sleep - Seconds $ChromeStartDelay
4547}
4648
4749function Cockpit-Start ($MonitorNum )
You can’t perform that action at this time.
0 commit comments