From d388df4f0091e68aba675035f5ee0fbee924b91b Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Fri, 9 Aug 2024 01:32:25 +0100 Subject: [PATCH] feat(rotating lockscreen): powershell rewrite --- .../tweaks/qol/appearance/atlas-theme.yml | 11 +++++++++-- src/playbook/Executables/THEME.cmd | 9 --------- 2 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 src/playbook/Executables/THEME.cmd diff --git a/src/playbook/Configuration/tweaks/qol/appearance/atlas-theme.yml b/src/playbook/Configuration/tweaks/qol/appearance/atlas-theme.yml index 686c5b64a5..26144b5a2b 100644 --- a/src/playbook/Configuration/tweaks/qol/appearance/atlas-theme.yml +++ b/src/playbook/Configuration/tweaks/qol/appearance/atlas-theme.yml @@ -35,9 +35,16 @@ actions: value: 'RotatingLockScreenEnabled' data: '0' type: REG_DWORD - - !run: - exe: 'THEME.cmd' + - !powerShell: + command: | + $env:PSModulePath += """;$PWD\AtlasModules\Scripts\Modules""" + foreach ($userKey in (Get-RegUserPaths -NoDefault).PsPath) { + Set-ItemProperty ` + -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\$(Split-Path $userKey -Leaf)" ` + -Name 'RotatingLockScreenEnabled' -Type DWORD -Value 0 -Force + } exeDir: true + wait: true - !powerShell: command: '& ".\AtlasModules\Scripts\LOCKSCREEN.ps1"' exeDir: true diff --git a/src/playbook/Executables/THEME.cmd b/src/playbook/Executables/THEME.cmd deleted file mode 100644 index 2a8478a928..0000000000 --- a/src/playbook/Executables/THEME.cmd +++ /dev/null @@ -1,9 +0,0 @@ -@echo off - -for /f "usebackq tokens=2 delims=\" %%a in (`reg query "HKEY_USERS" ^| findstr /r /x /c:"HKEY_USERS\\S-.*" /c:"HKEY_USERS\\AME_UserHive_[^_]*"`) do ( - reg query "HKEY_USERS\%%a" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > nul && ( - if not "%%a" == "AME_UserHive_Default" reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\%%a" /v "RotatingLockScreenEnabled" /t REG_DWORD /d "0" /f > nul - ) -) - -exit /b \ No newline at end of file