mirror of
https://github.com/RustyRaptor/deckhud.git
synced 2026-12-03 15:55:16 -07:00
Bundles Qt 6.8, LayerShellQt v6.4.5 and the Wayland EGL client plugins (rpath-patched; linuxdeploy-plugin-qt skips them). CI builds it on every push and attaches it, with a .zsync for delta updates, to v* releases. Drop LayerShell.Window.activateOnShow, which LayerShellQt < 6.5 lacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013UzjWSBjtVZ2zi8fJxS2hH
51 lines
1.5 KiB
QML
51 lines
1.5 KiB
QML
import QtQuick
|
|
import QtWebSockets
|
|
import org.kde.layershell as LayerShell
|
|
import "components"
|
|
|
|
// Full-screen, click-through overlay. Usage: qml main.qml -- ws://127.0.0.1:PORT/TOKEN
|
|
Window {
|
|
id: window
|
|
|
|
readonly property string daemonUrl: Qt.application.arguments.find(a => a.startsWith("ws://")) ?? ""
|
|
|
|
visible: true
|
|
color: "transparent"
|
|
flags: Qt.FramelessWindowHint | Qt.WindowTransparentForInput | Qt.WindowDoesNotAcceptFocus
|
|
title: "deckhud"
|
|
|
|
LayerShell.Window.scope: "deckhud"
|
|
LayerShell.Window.layer: LayerShell.Window.LayerOverlay
|
|
LayerShell.Window.anchors: LayerShell.Window.AnchorTop | LayerShell.Window.AnchorBottom
|
|
| LayerShell.Window.AnchorLeft | LayerShell.Window.AnchorRight
|
|
LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone
|
|
LayerShell.Window.exclusionZone: -1
|
|
|
|
Hud {
|
|
id: hud
|
|
anchors.fill: parent
|
|
}
|
|
|
|
WebSocket {
|
|
id: socket
|
|
url: window.daemonUrl
|
|
active: window.daemonUrl !== ""
|
|
onTextMessageReceived: message => hud.handleText(message)
|
|
onStatusChanged: {
|
|
if (socket.status === WebSocket.Error)
|
|
console.warn("deckhud: socket error:", socket.errorString)
|
|
if (socket.status === WebSocket.Error || socket.status === WebSocket.Closed)
|
|
reconnect.restart()
|
|
}
|
|
}
|
|
|
|
Timer {
|
|
id: reconnect
|
|
interval: 1000
|
|
onTriggered: {
|
|
socket.active = false
|
|
socket.active = true
|
|
}
|
|
}
|
|
}
|