mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(bootstrap): Initialise windows script
This commit is contained in:
parent
1cdb00ba50
commit
1025053406
12 changed files with 314 additions and 99 deletions
21
bootstrap/win/Tasks.ps1
Normal file
21
bootstrap/win/Tasks.ps1
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#Requires -RunAsAdministrator
|
||||
|
||||
Write-Output "[INFO] Setting up KMonad Tasks"
|
||||
|
||||
# PowerShell Path, use 7 if available
|
||||
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
||||
$PowerShellPath = (Get-Command "pwsh").Source
|
||||
}
|
||||
else {
|
||||
$PowerShellPath = (Get-Command "powershell").Source
|
||||
}
|
||||
|
||||
$DotStartUpPath = "$Env:DOTFILES\platforms\win\start"
|
||||
|
||||
$KMonadRunnerPath = Join-Path $DotStartUpPath "KMonad.ps1"
|
||||
$Action = New-ScheduledTaskAction -Execute $PowerShellPath -Argument "-NoProfile -ExecutionPolicy Bypass -File $KMonadRunnerPath"
|
||||
$Trigger = New-ScheduledTaskTrigger -AtLogOn
|
||||
$Principal = New-ScheduledTaskPrincipal -UserId "$env:USERNAME" -LogonType Interactive -RunLevel Highest
|
||||
$Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -DontStopOnIdleEnd -Hidden
|
||||
|
||||
Register-ScheduledTask -TaskName "Start Kmonad" -Action $Action -Trigger $Trigger -Principal $Principal -Settings $Settings -TaskPath "\Personal"
|
||||
Loading…
Add table
Add a link
Reference in a new issue