using initialTitle instead of currentTitle

This commit is contained in:
Zacharias-Brohn
2025-10-14 20:58:34 +02:00
parent 2350b6db28
commit 800f3c53e7
6 changed files with 52 additions and 15 deletions
+22 -1
View File
@@ -1,15 +1,36 @@
import QtQuick
import QtQuick.Layouts
import Quickshell.Io
import Quickshell.Hyprland
Item {
id: root
property string currentTitle
Layout.fillHeight: true
Layout.preferredWidth: Math.max( titleText1.implicitWidth, titleText2.implicitWidth ) + 10
clip: true
property string currentTitle: ActiveWindow.activeWindow
property bool showFirst: true
Process {
id: initialTitleProc
command: ["./scripts/initialTitle.sh"]
running: false
stdout: StdioCollector {
onStreamFinished: {
root.currentTitle = this.text.trim().replace(/\"/g, "")
}
}
}
Component.onCompleted: {
Hyprland.rawEvent.connect(( event ) => {
if (event.name === "activewindow") {
initialTitleProc.running = true
}
})
}
onCurrentTitleChanged: {
if (showFirst) {
titleText2.text = currentTitle