diff --git a/.gitattributes b/.gitattributes index 4f067a0d9b..49b7c76ead 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ -# perform crlf normalization on batch and cmd files -*.ps1 eol=crlf -*.psm1 eol=crlf -*.bat eol=crlf -*.cmd eol=crlf -*.sh eol=lf +# Line ending normalization +*.ps1 eol=lf +*.psm1 eol=lf +*.bat eol=crlf +*.cmd eol=crlf +*.sh eol=lf diff --git a/.gitignore b/.gitignore index ebe559b054..a59a9ded0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Claude Code +.claude/ + # MacOS .DS_Store diff --git a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Hide Lock Screen.cmd b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Hide Lock Screen.cmd deleted file mode 100644 index fcbc952cab..0000000000 --- a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Hide Lock Screen.cmd +++ /dev/null @@ -1,31 +0,0 @@ -@echo off -:: Change to match the setting name (e.g., Sleep, Indexing, etc.) -set "settingName=LockScreen" -:: Change to 0 (Disabled) or 1 (Enabled/Minimal) etc -set "stateValue=1" -set "scriptPath=%~f0" - -set "___args="%~f0" %*" -fltmc > nul 2>&1 || ( - echo Administrator privileges are required. - powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || ( - echo You must run this script as admin. - if "%*"=="" pause - exit /b 1 - ) - exit /b -) - -:: Update Registry (State and Path) -reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul -reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul - -:: End of state and path update - -reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /t REG_DWORD /v NoLockScreen /d "1" /f > nul -if "%~1"=="/silent" exit /b - -echo Changes applied successfully. -echo Press any key to exit... -pause > nul -exit /b \ No newline at end of file diff --git a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Hide Lock Screen.ps1 b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Hide Lock Screen.ps1 new file mode 100644 index 0000000000..6f86aa0f69 --- /dev/null +++ b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Hide Lock Screen.ps1 @@ -0,0 +1,53 @@ +#Requires -Version 5.1 +# ============================================================================ +# AtlasOS -- Hide Lock Screen +# Disables the Windows lock screen via registry policy. +# Sets NoLockScreen and NoChangingLockScreen so Settings stay accessible +# (prevents the "managed by your organization" greyed-out state). +# ============================================================================ + +param( + [switch]$Silent +) + +$ErrorActionPreference = 'Stop' + +$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole( + [Security.Principal.WindowsBuiltInRole]::Administrator +) +if (-not $isAdmin) { + $argList = "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" + if ($Silent) { $argList += ' -Silent' } + try { + Start-Process -FilePath 'powershell.exe' -ArgumentList $argList -Verb RunAs -Wait + } catch { + Write-Host '[!!] Administrator privileges are required.' -ForegroundColor Red + if (-not $Silent) { Read-Host 'Press Enter to exit' } + exit 1 + } + exit 0 +} + +$settingName = 'LockScreen' +$stateValue = 0 +$scriptPath = $PSCommandPath + +try { + $atlasKey = "HKLM:\SOFTWARE\AtlasOS\Services\$settingName" + if (-not (Test-Path $atlasKey)) { New-Item -Path $atlasKey -Force | Out-Null } + Set-ItemProperty -Path $atlasKey -Name 'state' -Value $stateValue -Type DWord -Force + Set-ItemProperty -Path $atlasKey -Name 'path' -Value $scriptPath -Type String -Force + + $policyKey = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization' + if (-not (Test-Path $policyKey)) { New-Item -Path $policyKey -Force | Out-Null } + Set-ItemProperty -Path $policyKey -Name 'NoLockScreen' -Value 1 -Type DWord -Force + Set-ItemProperty -Path $policyKey -Name 'NoChangingLockScreen' -Value 1 -Type DWord -Force + + if (-not $Silent) { + Write-Host '[OK] Lock screen hidden.' -ForegroundColor Green + Read-Host 'Press Enter to exit' + } +} catch { + Write-Host "[!!] Failed to hide lock screen: $_" -ForegroundColor Red + exit 1 +} \ No newline at end of file diff --git a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Show Lock Screen (default).cmd b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Show Lock Screen (default).cmd deleted file mode 100644 index 4858a42950..0000000000 --- a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Show Lock Screen (default).cmd +++ /dev/null @@ -1,31 +0,0 @@ -@echo off -:: Change to match the setting name (e.g., Sleep, Indexing, etc.) -set "settingName=LockScreen" -:: Change to 0 (Disabled) or 1 (Enabled/Minimal) etc -set "stateValue=1" -set "scriptPath=%~f0" - -set "___args="%~f0" %*" -fltmc > nul 2>&1 || ( - echo Administrator privileges are required. - powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || ( - echo You must run this script as admin. - if "%*"=="" pause - exit /b 1 - ) - exit /b -) - -:: Update Registry (State and Path) -reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul -reg add "HKLM\SOFTWARE\AtlasOS\Services\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul - -:: End of state and path update - -reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /t REG_DWORD /v NoLockScreen /f > nul -if "%~1"=="/silent" exit /b - -echo Changes applied successfully. -echo Press any key to exit... -pause > nul -exit /b \ No newline at end of file diff --git a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Show Lock Screen (default).ps1 b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Show Lock Screen (default).ps1 new file mode 100644 index 0000000000..e71ce9ae33 --- /dev/null +++ b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Lock Screen/Show Lock Screen (default).ps1 @@ -0,0 +1,54 @@ +#Requires -Version 5.1 +# ============================================================================ +# AtlasOS -- Show Lock Screen (default) +# Restores the Windows lock screen to its default (visible) state. +# Removes NoLockScreen and NoChangingLockScreen so Settings are no longer +# greyed out / "managed by your organization". +# ============================================================================ + +param( + [switch]$Silent +) + +$ErrorActionPreference = 'Stop' + +$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole( + [Security.Principal.WindowsBuiltInRole]::Administrator +) +if (-not $isAdmin) { + $argList = "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" + if ($Silent) { $argList += ' -Silent' } + try { + Start-Process -FilePath 'powershell.exe' -ArgumentList $argList -Verb RunAs -Wait + } + catch { + Write-Host '[!!] Administrator privileges are required.' -ForegroundColor Red + if (-not $Silent) { Read-Host 'Press Enter to exit' } + exit 1 + } + exit 0 +} + +$settingName = 'LockScreen' +$stateValue = 1 +$scriptPath = $PSCommandPath + +try { + $atlasKey = "HKLM:\SOFTWARE\AtlasOS\Services\$settingName" + if (-not (Test-Path $atlasKey)) { New-Item -Path $atlasKey -Force | Out-Null } + Set-ItemProperty -Path $atlasKey -Name 'state' -Value $stateValue -Type DWord -Force + Set-ItemProperty -Path $atlasKey -Name 'path' -Value $scriptPath -Type String -Force + + $policyKey = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization' + Remove-ItemProperty -Path $policyKey -Name 'NoLockScreen' -ErrorAction SilentlyContinue + Remove-ItemProperty -Path $policyKey -Name 'NoChangingLockScreen' -ErrorAction SilentlyContinue + + if (-not $Silent) { + Write-Host '[OK] Lock screen restored.' -ForegroundColor Green + Read-Host 'Press Enter to exit' + } +} +catch { + Write-Host "[!!] Failed to restore lock screen: $_" -ForegroundColor Red + exit 1 +} diff --git a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Restart Explorer.cmd b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Restart Explorer.cmd deleted file mode 100644 index d1e88dba4d..0000000000 --- a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Restart Explorer.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -taskkill /f /im explorer.exe -start %windir%\explorer.exe" \ No newline at end of file diff --git a/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Restart Explorer.ps1 b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Restart Explorer.ps1 new file mode 100644 index 0000000000..dc77f6b166 --- /dev/null +++ b/src/playbook/Executables/AtlasDesktop/4. Interface Tweaks/Restart Explorer.ps1 @@ -0,0 +1,10 @@ +#Requires -Version 5.1 +# ============================================================================ +# AtlasOS -- Restart Explorer +# Restarts Windows Explorer to apply pending UI changes. +# Windows automatically relaunches explorer.exe as the shell after termination. +# ============================================================================ + +Write-Host '[>>] Restarting Explorer...' -ForegroundColor Yellow +Stop-Process -Name 'explorer' -Force -ErrorAction SilentlyContinue +Write-Host '[OK] Explorer restarted.' -ForegroundColor Green \ No newline at end of file diff --git a/src/playbook/Executables/DEFAULT.ps1 b/src/playbook/Executables/DEFAULT.ps1 index 1ac49c21ef..01261d9d5e 100644 --- a/src/playbook/Executables/DEFAULT.ps1 +++ b/src/playbook/Executables/DEFAULT.ps1 @@ -16,7 +16,11 @@ Get-ChildItem -Path $registryPath | ForEach-Object { $scriptPath = $path.path if (Test-Path $scriptPath) { Write-Host "Running: $scriptPath" -ForegroundColor Cyan - & $scriptPath /silent + if ($scriptPath -like '*.ps1') { + & $scriptPath -Silent + } else { + & $scriptPath /silent + } } else { Write-Host "Script not found: $scriptPath" -ForegroundColor Red } diff --git a/src/playbook/Executables/DEFAULT.reg b/src/playbook/Executables/DEFAULT.reg index 03b4adce16..b6687cbf2d 100644 Binary files a/src/playbook/Executables/DEFAULT.reg and b/src/playbook/Executables/DEFAULT.reg differ