Turn the lock screen into an unfolding glass dashboard
At rest the lock screen shows the date, glass clock and Now Playing. Typing or clicking opens a glass card with avatar, name, status and password, then wings unfold: weather (with the next forecasts) and system usage on the left, notifications and media with Cava on the right, reusing the desktop widget faces. Adds a Caps Lock warning, power controls behind a corner button, and Dashboard and Notification previews settings. The screenshot backdrop is now always fully blurred and dimmed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4fa0c2c042
commit
b96b0cb683
12 files changed
+1114
-330
No files matched your search
@@ -0,0 +1,163 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "../services"
|
||||
import "../theme"
|
||||
|
||||
// Notifications on the lock screen, newest first. Read-only: nothing can be
|
||||
// opened or acted on while locked, and bodies show only with previews on.
|
||||
ColumnLayout {
|
||||
id: root
|
||||
property real unit: 1
|
||||
function s(value) {
|
||||
return Math.round(value * unit);
|
||||
}
|
||||
readonly property bool previews: LockState.options.notificationPreviews
|
||||
spacing: s(10)
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: root.s(4)
|
||||
spacing: root.s(8)
|
||||
Text {
|
||||
text: "Notifications"
|
||||
color: "#ffffff"
|
||||
font.pixelSize: root.s(13)
|
||||
font.weight: Font.DemiBold
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
visible: NotificationService.dnd
|
||||
text: Icons.available ? "" : "Do Not Disturb"
|
||||
font.family: Icons.available ? Icons.family : ""
|
||||
color: Qt.alpha("#ffffff", 0.6)
|
||||
font.pixelSize: root.s(13)
|
||||
}
|
||||
Rectangle {
|
||||
visible: list.count > 0
|
||||
implicitWidth: Math.max(height, countText.implicitWidth + root.s(12))
|
||||
implicitHeight: root.s(20)
|
||||
radius: height / 2
|
||||
color: Qt.alpha("#ffffff", 0.14)
|
||||
Text {
|
||||
id: countText
|
||||
anchors.centerIn: parent
|
||||
text: list.count
|
||||
color: "#ffffff"
|
||||
font.pixelSize: root.s(11)
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
id: list
|
||||
objectName: "lockNotifications"
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
clip: true
|
||||
spacing: root.s(8)
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
model: ScriptModel {
|
||||
values: NotificationService.active ? NotificationService.list : []
|
||||
}
|
||||
delegate: Rectangle {
|
||||
id: card
|
||||
required property var modelData
|
||||
readonly property string icon: NotificationService.iconFor(modelData)
|
||||
width: list.width
|
||||
height: row.implicitHeight + root.s(20)
|
||||
radius: root.s(14)
|
||||
color: Qt.alpha("#ffffff", 0.08)
|
||||
border.width: NotificationService.critical(modelData) ? 1 : 0
|
||||
border.color: Qt.alpha(Theme.urgent, 0.6)
|
||||
RowLayout {
|
||||
id: row
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: root.s(10)
|
||||
spacing: root.s(10)
|
||||
Item {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.preferredWidth: root.s(30)
|
||||
Layout.preferredHeight: root.s(30)
|
||||
Image {
|
||||
id: appIcon
|
||||
anchors.fill: parent
|
||||
source: card.icon
|
||||
sourceSize: Qt.size(64, 64)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
asynchronous: true
|
||||
visible: status === Image.Ready
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: appIcon.status !== Image.Ready
|
||||
radius: root.s(8)
|
||||
color: Qt.alpha("#ffffff", 0.15)
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: NotificationService.appLabel(card.modelData).charAt(0).toUpperCase()
|
||||
color: "#ffffff"
|
||||
font.pixelSize: root.s(13)
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: root.s(2)
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: root.s(6)
|
||||
Text {
|
||||
text: NotificationService.appLabel(card.modelData)
|
||||
color: Qt.alpha("#ffffff", 0.7)
|
||||
font.pixelSize: root.s(11)
|
||||
font.weight: Font.DemiBold
|
||||
elide: Text.ElideRight
|
||||
textFormat: Text.PlainText
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: NotificationService.since(card.modelData)
|
||||
color: Qt.alpha("#ffffff", 0.5)
|
||||
font.pixelSize: root.s(10)
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: card.modelData.summary
|
||||
color: "#ffffff"
|
||||
font.pixelSize: root.s(12)
|
||||
font.weight: Font.DemiBold
|
||||
elide: Text.ElideRight
|
||||
textFormat: Text.PlainText
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
visible: root.previews && text !== ""
|
||||
text: card.modelData.body
|
||||
color: Qt.alpha("#ffffff", 0.75)
|
||||
font.pixelSize: root.s(11)
|
||||
textFormat: Text.StyledText
|
||||
wrapMode: Text.Wrap
|
||||
maximumLineCount: 2
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - root.s(24)
|
||||
visible: list.count === 0
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: NotificationService.active ? "No Notifications" : NotificationService.notice || "Notifications are off"
|
||||
color: Qt.alpha("#ffffff", 0.55)
|
||||
font.pixelSize: root.s(12)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,10 @@ Singleton {
|
||||
// Live lock surfaces, for diagnostics and tests.
|
||||
property var surfaces: []
|
||||
property string realName: ""
|
||||
// Active keyboard layout, read from Hyprland when the lock screen shows.
|
||||
// Active keyboard layout and Caps Lock, read from Hyprland when the lock
|
||||
// screen shows and again whenever Caps Lock is pressed.
|
||||
property string layout: ""
|
||||
property bool capsLock: false
|
||||
readonly property bool shown: locked || previewing
|
||||
readonly property string runtimeDir: (Quickshell.env("XDG_RUNTIME_DIR") || "/tmp") + "/glassMxrph"
|
||||
|
||||
@@ -107,6 +109,10 @@ Singleton {
|
||||
testResult = "";
|
||||
return submit(password, "test");
|
||||
}
|
||||
function probeKeyboard() {
|
||||
layoutProbe.running = false;
|
||||
layoutProbe.running = true;
|
||||
}
|
||||
function finishUnlock() {
|
||||
unlocking = true;
|
||||
unlockTimer.restart();
|
||||
@@ -184,7 +190,7 @@ Singleton {
|
||||
}
|
||||
}
|
||||
onShownChanged: if (shown)
|
||||
layoutProbe.running = true
|
||||
probeKeyboard()
|
||||
Process {
|
||||
id: layoutProbe
|
||||
command: ["hyprctl", "devices", "-j"]
|
||||
@@ -194,8 +200,10 @@ Singleton {
|
||||
const keyboards = JSON.parse(text).keyboards || [];
|
||||
const main = keyboards.find(k => k.main) || keyboards[0];
|
||||
root.layout = main && main.active_keymap ? main.active_keymap.slice(0, 2).toUpperCase() : "";
|
||||
root.capsLock = keyboards.some(k => k.capsLock);
|
||||
} catch (e) {
|
||||
root.layout = "";
|
||||
root.capsLock = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+801
-291
File diff suppressed because it is too large.
Load diff
@@ -2,3 +2,4 @@ singleton LockState 1.0 LockState.qml
|
||||
Lock 1.0 Lock.qml
|
||||
LockSurface 1.0 LockSurface.qml
|
||||
GlassSurface 1.0 GlassSurface.qml
|
||||
LockNotifications 1.0 LockNotifications.qml
|
||||
Reference in new issue
Block a user