Skip to content

Commit

Permalink
Keep Only generic staff
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrTomin committed Apr 9, 2015
1 parent d905101 commit 66e11d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
19 changes: 6 additions & 13 deletions Artifacts/Ciklum-Kiosk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,14 @@

$chromePath = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
$chromeArguments = '--new-window --incognito'
$cockpitPath = 'C:\Kiosk-Mode\Cockpit.CommunicationSpace.appref-ms'
# if Window not moved (especially on machine start) - try increaing the delay.
$ChromeStartDelay = 3

Set-Location $PSScriptRoot
. .\HelperFunctions.ps1

#Kill all running
&taskkill /im chrome* /F
&taskkill /im Ciklum.Cockpit.CommunicationSpace* /F
# Kill all running instances
# &taskkill /im chrome* /F


Cockpit-Start -MonitorNum 2 #middle top

Chrome-Kiosk 'http://dashboard.hubclone.pp.ciklum.com/dashboard/externalRequests' -MonitorNum 4 #left
Chrome-Kiosk 'http://dashboard.hubclone.pp.ciklum.com/dashboard/externalProjects' -MonitorNum 1 #middle bottom
Chrome-Kiosk 'http://dashboard.hubclone.pp.ciklum.com/dashboard/metrixDashboards' -MonitorNum 3 #right


Pause
Chrome-Kiosk 'http://google.com' -MonitorNum 1
Chrome-Kiosk 'http://http://www.bbc.com/' -MonitorNum 2
10 changes: 6 additions & 4 deletions Artifacts/HelperFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Add-Type -Path Tomin.Tools.KioskMode.dll
$WinAPI = [Tomin.Tools.KioskMode.WinApi]
$Helpers = [Tomin.Tools.KioskMode.Helper]

# todo: optimize to avoid endless loop;
if (!$ChromeStartDelay) {$ChromeStartDelay = 3}
if (!$chromePath) {$chromePath = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'}
if (!$chromeArguments) {$chromeArguments = '--new-window --incognito'}

function Wait-ForProcess($procName, $procTitle)
{
$sw = [Diagnostics.Stopwatch]::StartNew()
Expand All @@ -33,15 +36,14 @@ function Chrome-Kiosk($Url, $MonitorNum)
{
Write-Output "starting chrome $Url , monitor: $MonitorNum"
Start-Process $chromePath "$chromeArguments $Url"
Start-Sleep -Seconds 5
Start-Sleep -Seconds $ChromeStartDelay

$window = (Get-Process -Name chrome | where MainWindowHandle -ne ([IntPtr]::Zero) | select -First 1).MainWindowHandle

$WinAPI::ShowWindow($window, [Tomin.Tools.KioskMode.Enums.ShowWindowCommands]::Restore)
$Helpers::MoveToMonitor($window, $MonitorNum)
$Helpers::SendKey($window, '{F11}')
Start-Sleep -Seconds 3

Start-Sleep -Seconds $ChromeStartDelay
}

function Cockpit-Start($MonitorNum)
Expand Down

0 comments on commit 66e11d6

Please sign in to comment.