diff --git a/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml b/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml index e942f4fda..3d6506c54 100644 --- a/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml +++ b/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml @@ -72,7 +72,7 @@ Scope { } // Unlock the keyring if configured to do so - if (Config.options.lock.security.unlockKeyring) root.unlockKeyring(); + if (Config.options.lock.security.unlockKeyring) root.unlockKeyring(); // Async // Unlock the screen before exiting, or the compositor will display a // fallback lock you can't interact with. @@ -83,6 +83,12 @@ Scope { // Reset lockContext.reset(); + + // Post-unlock actions + if (lockContext.alsoInhibitIdle) { + lockContext.alsoInhibitIdle = false; + Idle.toggleInhibit(true); + } } } diff --git a/dots/.config/quickshell/ii/modules/ii/lock/LockContext.qml b/dots/.config/quickshell/ii/modules/ii/lock/LockContext.qml index b242cdc05..e6454b476 100644 --- a/dots/.config/quickshell/ii/modules/ii/lock/LockContext.qml +++ b/dots/.config/quickshell/ii/modules/ii/lock/LockContext.qml @@ -21,6 +21,7 @@ Scope { property bool showFailure: false property bool fingerprintsConfigured: false property var targetAction: LockContext.ActionEnum.Unlock + property bool alsoInhibitIdle: false function resetTargetAction() { root.targetAction = LockContext.ActionEnum.Unlock; @@ -58,7 +59,8 @@ Scope { passwordClearTimer.restart(); } - function tryUnlock() { + function tryUnlock(alsoInhibitIdle = false) { + root.alsoInhibitIdle = alsoInhibitIdle; root.unlockInProgress = true; pam.start(); } diff --git a/dots/.config/quickshell/ii/modules/ii/lock/LockSurface.qml b/dots/.config/quickshell/ii/modules/ii/lock/LockSurface.qml index da3e17627..e44eecacb 100644 --- a/dots/.config/quickshell/ii/modules/ii/lock/LockSurface.qml +++ b/dots/.config/quickshell/ii/modules/ii/lock/LockSurface.qml @@ -59,10 +59,20 @@ MouseArea { } // Key presses + property bool ctrlHeld: false Keys.onPressed: event => { root.context.resetClearTimer(); + if (event.key === Qt.Key_Control) { + root.ctrlHeld = true; + } if (event.key === Qt.Key_Escape) { // Esc to clear root.context.currentText = ""; + } + forceFieldFocus(); + } + Keys.onReleased: event => { + if (event.key === Qt.Key_Control) { + root.ctrlHeld = false; } forceFieldFocus(); } @@ -133,7 +143,9 @@ MouseArea { // Synchronizing (across monitors) and unlocking onTextChanged: root.context.currentText = this.text - onAccepted: root.context.tryUnlock() + onAccepted: { + root.context.tryUnlock(ctrlHeld); + } Connections { target: root.context function onCurrentTextChanged() { @@ -202,7 +214,7 @@ MouseArea { iconSize: 24 text: { if (root.context.targetAction === LockContext.ActionEnum.Unlock) { - return "arrow_right_alt"; + return root.ctrlHeld ? "emoji_food_beverage" : "arrow_right_alt"; } else if (root.context.targetAction === LockContext.ActionEnum.Poweroff) { return "power_settings_new"; } else if (root.context.targetAction === LockContext.ActionEnum.Reboot) { diff --git a/dots/.config/quickshell/ii/modules/ii/regionSelector/RegionSelection.qml b/dots/.config/quickshell/ii/modules/ii/regionSelector/RegionSelection.qml index a52471ba6..8f484591b 100644 --- a/dots/.config/quickshell/ii/modules/ii/regionSelector/RegionSelection.qml +++ b/dots/.config/quickshell/ii/modules/ii/regionSelector/RegionSelection.qml @@ -26,7 +26,7 @@ PanelWindow { bottom: true } - // TODO: Ask: sidebar AI; Ocr: tesseract + // TODO: Ask: sidebar AI enum SnipAction { Copy, Edit, Search, CharRecognition, Record, RecordWithSound } enum SelectionMode { RectCorners, Circle } property var action: RegionSelection.SnipAction.Copy diff --git a/dots/.config/quickshell/ii/services/Idle.qml b/dots/.config/quickshell/ii/services/Idle.qml index ad938f3c3..a2b804772 100644 --- a/dots/.config/quickshell/ii/services/Idle.qml +++ b/dots/.config/quickshell/ii/services/Idle.qml @@ -1,8 +1,8 @@ +pragma Singleton import qs.modules.common import QtQuick import Quickshell import Quickshell.Wayland -pragma Singleton /** * A nice wrapper for date and time strings. @@ -17,21 +17,26 @@ Singleton { target: Persistent function onReadyChanged() { if (!Persistent.isNewHyprlandInstance) { - root.inhibit = Persistent.states.idle.inhibit + root.inhibit = Persistent.states.idle.inhibit; } else { - Persistent.states.idle.inhibit = root.inhibit + Persistent.states.idle.inhibit = root.inhibit; } } } - function toggleInhibit() { - root.inhibit = !root.inhibit - Persistent.states.idle.inhibit = root.inhibit + function toggleInhibit(active = null) { + if (active !== null) { + root.inhibit = active; + } else { + root.inhibit = !root.inhibit; + } + Persistent.states.idle.inhibit = root.inhibit; } IdleInhibitor { id: idleInhibitor - window: PanelWindow { // Inhibitor requires a "visible" surface + window: PanelWindow { + // Inhibitor requires a "visible" surface // Actually not lol implicitWidth: 0 implicitHeight: 0 @@ -46,6 +51,5 @@ Singleton { item: null } } - } - + } }