From 08297376a85a1719518507e54fca9de954d2376a Mon Sep 17 00:00:00 2001 From: Petri Hienonen Date: Thu, 23 May 2024 13:56:00 +0300 Subject: Agenix configuration --- home/quickshell/bar/blocks/ActiveWorkspace.qml | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 home/quickshell/bar/blocks/ActiveWorkspace.qml (limited to 'home/quickshell/bar/blocks/ActiveWorkspace.qml') diff --git a/home/quickshell/bar/blocks/ActiveWorkspace.qml b/home/quickshell/bar/blocks/ActiveWorkspace.qml new file mode 100644 index 0000000..7969212 --- /dev/null +++ b/home/quickshell/bar/blocks/ActiveWorkspace.qml @@ -0,0 +1,34 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell.Io +import Quickshell.Hyprland +import "../" + +BarText { + // text: { + // var str = activeWindowTitle + // return str.length > chopLength ? str.slice(0, chopLength) + '...' : str; + // } + + property int chopLength + property string activeWindowTitle + + Process { + id: titleProc + command: ["sh", "-c", "hyprctl activewindow | grep title: | sed 's/^[^:]*: //'"] + running: true + + stdout: SplitParser { + onRead: data => activeWindowTitle = data + } + } + + Component.onCompleted: { + Hyprland.rawEvent.connect(hyprEvent) + } + + function hyprEvent(e) { + titleProc.running = true + } +} + -- cgit v1.2.3-70-g09d2