Skip to content

Commit 66e11d6

Browse files
author
OleksandrTomin
committed
Keep Only generic staff
1 parent d905101 commit 66e11d6

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

Artifacts/Ciklum-Kiosk.ps1

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,14 @@
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

1314
Set-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

Artifacts/HelperFunctions.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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+
1215
function 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

4749
function Cockpit-Start($MonitorNum)

0 commit comments

Comments
 (0)