Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ What `install.sh` and `revert.sh` change, how updates are handled, and why `sudo

## Tested setup

Made for Omarchy stable (4.5); `scripts/test-channels.sh` also runs the tests against rc and edge's
Made for Omarchy stable (4.6); `scripts/test-channels.sh` also runs the tests against rc and edge's
current packages. Used only with Quickshell 0.3.2.r7, on one NVIDIA GPU and one monitor, without
fingerprint unlock; a second screen only as a virtual display, at a different scale. Edge changed
Omarchy's lock in r8178, so there wheely keeps Omarchy's own lock. The installer refuses an Omarchy
fingerprint unlock; a second screen only as a virtual display, at a different scale. On 4.5 and on
edge, whose lock differs from 4.6's, wheely keeps Omarchy's own lock. The installer refuses an Omarchy
older than 4.5.0rc3 and does not check Quickshell.

It takes over `SUPER+A` and `SUPER+W`, and `Ctrl+Space` while one of its animated themes is
Expand Down
11 changes: 11 additions & 0 deletions lock-session/Bridge.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Item {
property int serial: 0
property bool passwordPamConfigured: false
readonly property bool locked: !!lockState.locked || !!(pending && pending.action === "lock")
// Set by the shell, which tells the bar and plugins the screen is locked.
property var publishSessionLocked: null
function syncSessionLocked() { if (typeof publishSessionLocked === "function") publishSessionLocked(locked) }
onLockedChanged: syncSessionLocked()
onPublishSessionLockedChanged: syncSessionLocked()
readonly property string directory: Quickshell.env("HOME") + "/.local/share/wheely/lock-session"
readonly property string socketPath: Quickshell.env("XDG_RUNTIME_DIR") + "/omarchy-lock-" +
Quickshell.env("WAYLAND_DISPLAY").replace(/[^a-zA-Z0-9_.-]/g, "_") + ".sock"
Expand Down Expand Up @@ -121,6 +126,12 @@ Item {
return "ok"
}
function isLocked(): string { return root.locked ? "true" : "false" }
// Opening a laptop lid asks for this; unlocked, omarchy-system-lid-open wakes the display itself.
function wake(): string {
if (!root.locked) return "unlocked"
root.request("wake")
return "ok"
}
function status(): string {
const result = Object.assign({}, root.lockState)
result.locked = root.locked
Expand Down
1 change: 1 addition & 0 deletions lock-session/shell.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ShellRoot {
service.previewVisible = true
}
} else if (pending.action === "hidePreview") service.previewVisible = false
else if (pending.action === "wake" && service.locked) service.runWake()
serial = pending.serial
pending = null
}
Expand Down
2 changes: 1 addition & 1 deletion lock/wallpaper/Scene.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Item {
// Built as Service.qml builds lockWallpaperUrl, so the service's decode serves this one: ahead
// of the lock in-process, alongside it in each lock's fresh worker. Never re-read while locked.
source: root.host.loadBackground && path
? Util.fileUrl(path) + (root.host.backgroundVersion ? "?v=" + root.host.backgroundVersion : "")
? Util.fileUrl(path) + "?" + root.host.backgroundVersionPrefix + "=" + root.host.backgroundVersion
: ""
fillMode: Image.PreserveAspectCrop
asynchronous: true
Expand Down
34 changes: 33 additions & 1 deletion patches/orig/plugins/lock/LockView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Item {
property string backgroundPath: ""
property string videoPosterPath: ""
property int backgroundVersion: 0
property string backgroundVersionPrefix: "v"
property size wallpaperDecodeSize: Qt.size(0, 0)
property bool fingerprintConfigured: false
property bool fingerprintUnavailable: false
property bool authenticatingPassword: false
Expand All @@ -19,6 +21,7 @@ Item {
property bool loadBackground: true
property string passwordText: ""
property bool syncingPasswordText: false
property bool viewReady: false

readonly property string placeholderText: Commons.I18n.t("lock.enterPassword")
readonly property int fieldWidth: 381
Expand Down Expand Up @@ -79,6 +82,16 @@ Item {
}

onPasswordTextChanged: syncPasswordText()
// Shake on a wrong password, not on initial construction or reset to 0.
onFailedAttemptsChanged: {
if (!viewReady) return
if (failedAttempts > 0 && !Style.reduceMotion) {
shakeAnimation.restart()
} else {
shakeAnimation.stop()
shakeTransform.x = 0
}
}
onInputEnabledChanged: {
if (inputEnabled) Qt.callLater(forcePasswordFocus)
}
Expand All @@ -88,6 +101,7 @@ Item {
// when the keyboard returns, so typing went nowhere until the field was clicked.
Window.onActiveFocusItemChanged: Qt.callLater(restorePasswordFocus)
Component.onCompleted: {
viewReady = true
syncPasswordText()
if (inputEnabled) Qt.callLater(forcePasswordFocus)
}
Expand All @@ -112,13 +126,16 @@ Item {
anchors.fill: parent
path: root.loadBackground ? (root.video ? root.videoPosterPath : root.backgroundPath) : ""
version: root.backgroundVersion
versionPrefix: root.backgroundVersionPrefix
// Decode only once sized, at the lock's own size: an unsized first
// request decoded the file at its native resolution, then again once
// sized. That size is what the lock service keeps decoded ahead of the
// lock, so the first frame has the wallpaper.
cached: true
constrainDecode: true
decodeSize: Qt.size(width, height)
decodeSize: root.wallpaperDecodeSize.width > 0 && root.wallpaperDecodeSize.height > 0
? root.wallpaperDecodeSize
: Qt.size(width, height)
}

MultiEffect {
Expand Down Expand Up @@ -149,6 +166,21 @@ Item {
radius: Style.cornerRadius
clip: true

transform: Translate {
id: shakeTransform

// A head shaking no: four swings that die down, 250ms in all.
SequentialAnimation on x {
id: shakeAnimation
running: false
NumberAnimation { to: -14; duration: Style.duration(45); easing.type: Easing.OutQuad }
NumberAnimation { to: 12; duration: Style.duration(65); easing.type: Easing.InOutSine }
NumberAnimation { to: -8; duration: Style.duration(55); easing.type: Easing.InOutSine }
NumberAnimation { to: 4; duration: Style.duration(45); easing.type: Easing.InOutSine }
NumberAnimation { to: 0; duration: Style.duration(40); easing.type: Easing.OutQuad }
}
}

TextInput {
id: passwordInput
anchors.fill: parent
Expand Down
Loading