To use Win + L
in Jwno, you need to disable the Windows lock screen first.
Create a file named DisableLockWorkstation.reg
:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
"DisableLockWorkstation"=dword:00000001
And a file named EnableLockWorkstation.reg
:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
"DisableLockWorkstation"=-
Then use them in a Powershell script, say lock.ps1
:
$EnableReg = Join-Path $PSScriptRoot "EnableLockWorkstation.reg"
$DisableReg = Join-Path $PSScriptRoot "DisableLockWorkstation.reg"
reg import $EnableReg
sleep 0.5
rundll32 user32.dll,LockWorkStation
sleep 0.5
reg import $DisableReg
Whenever you want to lock the screen, run lock.ps1
(as administrator), instead of pressing Win + L
. Now you can bind Win + L
to whatever you like in Jwno.
You can bind the script to some keys in Jwno too:
(:define-key keymap
"Win + Enter L"
[:exec
true
"pwsh.exe"
"-WindowStyle"
"Hidden"
"-Command"
```Start-Process -FilePath "pwsh" -ArgumentList "C:\path\to\lock.ps1" -Verb RunAs -WindowStyle Hidden```]
"Lock screen")
Caveats:
Everything about the lock screen will be disabled, e.g. the screen will never be automatically locked, even after waking up from sleeping. And the UAC window will pop up everytime you run lock.ps1
.