aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/kdeconnect
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-14 19:18:24 +0200
committerDanilo M. <danix@danix.xyz>2026-09-14 19:18:24 +0200
commit6bf3730a54ccb4cdcf9d6050f51d2b11ab1754e4 (patch)
treed813ac20af9451ca3094d669dfa20d887272ac15 /desktop/modules/kdeconnect
parentb46f37d689d4a59a4915d4c53f482429c9c305c3 (diff)
downloadquickshell-6bf3730a54ccb4cdcf9d6050f51d2b11ab1754e4.tar.gz
quickshell-6bf3730a54ccb4cdcf9d6050f51d2b11ab1754e4.zip
feat(desktop): KDE Connect pairing
Outgoing pair and unpair go through kdeconnect-cli; accepting and rejecting an incoming request go straight to the daemon, since the CLI has no verb for them. The verification key is shown on the row while a pairing is in flight so the two ends can be compared. An incoming request is not noticed while the drawer is closed, because the poll only runs when it is open; the daemon keeps the request, so it is there on the next open.
Diffstat (limited to 'desktop/modules/kdeconnect')
-rw-r--r--desktop/modules/kdeconnect/KdeConnectPage.qml46
-rw-r--r--desktop/modules/kdeconnect/KdeConnectRow.qml8
2 files changed, 54 insertions, 0 deletions
diff --git a/desktop/modules/kdeconnect/KdeConnectPage.qml b/desktop/modules/kdeconnect/KdeConnectPage.qml
index 46a42f9..ba2c8e3 100644
--- a/desktop/modules/kdeconnect/KdeConnectPage.qml
+++ b/desktop/modules/kdeconnect/KdeConnectPage.qml
@@ -38,6 +38,52 @@ Column {
color: Theme.red
}
+ // Incoming pairing requests. The property persists while the drawer is
+ // closed, so a request raised then is still here when it opens.
+ Repeater {
+ model: page.mod.requests
+
+ Rectangle {
+ required property var modelData
+
+ width: page.width
+ implicitHeight: reqCol.implicitHeight + 16
+ radius: 8
+ color: Qt.alpha(Theme.accent, 0.12)
+ border.width: 1
+ border.color: Qt.alpha(Theme.accent, 0.4)
+
+ Column {
+ id: reqCol
+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: 10 }
+ spacing: 8
+
+ Text {
+ width: parent.width
+ elide: Text.ElideRight
+ text: page.mod.deviceName(modelData) + " wants to pair"
+ font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true }
+ color: Theme.text
+ }
+
+ Row {
+ spacing: 8
+
+ Button {
+ text: "Accept"
+ onClicked: page.mod.accept(modelData)
+ }
+
+ Button {
+ text: "Reject"
+ danger: true
+ onClicked: page.mod.reject(modelData)
+ }
+ }
+ }
+ }
+ }
+
Text {
width: page.width
visible: page.mod.paired.length > 0
diff --git a/desktop/modules/kdeconnect/KdeConnectRow.qml b/desktop/modules/kdeconnect/KdeConnectRow.qml
index 70cc6ce..0c58fc0 100644
--- a/desktop/modules/kdeconnect/KdeConnectRow.qml
+++ b/desktop/modules/kdeconnect/KdeConnectRow.qml
@@ -61,6 +61,8 @@ Rectangle {
: (row.device.reachable ? "Found" : "Not reachable");
if (row.device.charge !== "")
s += " " + row.device.charge + "%" + (row.device.charging ? " charging" : "");
+ if (row.device.key !== "")
+ s += " key " + row.device.key;
return s;
}
font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 }
@@ -96,6 +98,12 @@ Rectangle {
danger: true
onClicked: row.mod.unpair(row.device.id)
}
+
+ Button {
+ visible: !row.device.paired && row.device.reachable
+ text: "Pair"
+ onClicked: row.mod.pair(row.device.id)
+ }
}
}
}