Skip to content

Commit

Permalink
fix(lockscreen): make it work
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jan 4, 2024
1 parent 8d659aa commit 5c37012
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
16 changes: 7 additions & 9 deletions src/playbook/Configuration/tweaks/qol/appearance/atlas-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ actions:
exeDir: true
wait: true

# Set lockscreen
- !powerShell:
command: '.\LOCKSCREEN.ps1'
exeDir: true
wait: true
runas: currentUserElevated
- !taskKill: {name: 'SystemSettings', ignoreErrors: true}
- !taskKill: {name: 'control', ignoreErrors: true}

# Disable fun facts, tips, tricks, and more on lockscreen
- !registryValue:
path: 'HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization'
Expand Down Expand Up @@ -171,3 +162,10 @@ actions:
- !run: {exe: 'timeout', args: '/t 4 /nobreak'}
- !taskKill: {name: 'SystemSettings', ignoreErrors: true}
- !taskKill: {name: 'control', ignoreErrors: true}

# Set lockscreen
- !powerShell:
command: '& ".\AtlasModules\Scripts\LOCKSCREEN.ps1"'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Credit: https://superuser.com/a/1343640
$imagePath = "$env:windir\AtlasModules\Wallpapers\lockscreen.png"

$newImagePath = [System.IO.Path]::GetDirectoryName($imagePath) + '\' + (New-Guid).Guid + [System.IO.Path]::GetExtension($imagePath)
$newImagePath = [System.IO.Path]::GetTempPath() + (New-Guid).Guid + [System.IO.Path]::GetExtension($imagePath)
Copy-Item $imagePath $newImagePath
[Windows.System.UserProfile.LockScreen,Windows.System.UserProfile,ContentType=WindowsRuntime] | Out-Null
[Windows.System.UserProfile.LockScreen, Windows.System.UserProfile, ContentType = WindowsRuntime] | Out-Null
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
Expand All @@ -17,7 +17,7 @@ Function AwaitAction($WinRtAction) {
$netTask = $asTask.Invoke($null, @($WinRtAction))
$netTask.Wait(-1) | Out-Null
}
[Windows.Storage.StorageFile,Windows.Storage,ContentType=WindowsRuntime] | Out-Null
[Windows.Storage.StorageFile, Windows.Storage, ContentType = WindowsRuntime] | Out-Null
$image = Await ([Windows.Storage.StorageFile]::GetFileFromPathAsync($newImagePath)) ([Windows.Storage.StorageFile])
AwaitAction ([Windows.System.UserProfile.LockScreen]::SetImageFileAsync($image))
Remove-Item $newImagePath
7 changes: 5 additions & 2 deletions src/playbook/Executables/AtlasModules/Scripts/newUsers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ $title = 'Preparing Atlas user settings...'
$Host.UI.RawUI.WindowTitle = $title
Write-Host $title -ForegroundColor Yellow
Write-Host $('-' * ($title.length + 3)) -ForegroundColor Yellow
Write-Host 'You''ll be logged out in 10 to 20 seconds, and once you login again, your new account will be ready for use.'
Write-Host "You'll be logged out in 10 to 20 seconds, and once you login again, your new account will be ready for use."

# Disable Windows 11 context menu & 'Gallery' in File Explorer
if ([System.Environment]::OSVersion.Version.Build -ge 22000) {
reg import "$env:windir\AtlasDesktop\4. Optional Tweaks\Windows 11 Context Menu\Old Context Menu (default).reg" *>$null
reg import "$env:windir\AtlasDesktop\4. Optional Tweaks\File Explorer Customization\Gallery\Disable Gallery (default).reg" *>$null
}

# Set lockscreen wallpaper
& "$env:windir\AtlasModules\Scripts\lockscreen.ps1"

# Disable 'Network' in navigation pane
reg import "$env:windir\AtlasDesktop\3. Configuration\Network Discovery\Network Navigation Pane\Disable Network Navigation Pane (default).reg" *>$null

# Set visual effects
Start-Process -FilePath "$env:windir\AtlasDesktop\3. Configuration\Visual Effects\Atlas Visual Effects (default).cmd" -ArgumentList '/silent' -WindowStyle Hidden
& "$env:windir\AtlasDesktop\3. Configuration\Visual Effects\Atlas Visual Effects (default).cmd" /silent

# Pin 'Videos' and 'Music' folders to Home/Quick Acesss
$o = new-object -com shell.application
Expand Down

0 comments on commit 5c37012

Please sign in to comment.