diff options
Diffstat (limited to 'home/quickshell/bar/blocks/ActiveWorkspace.qml')
| -rw-r--r-- | home/quickshell/bar/blocks/ActiveWorkspace.qml | 34 |
1 files changed, 34 insertions, 0 deletions
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 + } +} + |
