aboutsummaryrefslogtreecommitdiff
path: root/modules/system/quickshell/Workspaces.qml
diff options
context:
space:
mode:
authorLeander Scherer <leander@schererleander.de>2026-06-29 21:08:42 +0200
committerLeander Scherer <leander@schererleander.de>2026-06-29 21:22:33 +0200
commit67b7245bf96cf954d90719e800cf9618ffaa4feb (patch)
tree2723c3db278840150985cdc630487ff175d330d9 /modules/system/quickshell/Workspaces.qml
parentd4fa3d0533c8dac688e38413403815de1802339e (diff)
chore: cleanup sway, quickshell
Diffstat (limited to 'modules/system/quickshell/Workspaces.qml')
-rw-r--r--modules/system/quickshell/Workspaces.qml102
1 files changed, 0 insertions, 102 deletions
diff --git a/modules/system/quickshell/Workspaces.qml b/modules/system/quickshell/Workspaces.qml
deleted file mode 100644
index 44c0743..0000000
--- a/modules/system/quickshell/Workspaces.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-import Quickshell
-import Quickshell.Io
-import QtQuick
-
-Item {
- id: root
-
- implicitWidth: row.implicitWidth
- implicitHeight: 32
-
- ListModel {
- id: workspaceModel
- }
-
- function updateWorkspaces(json) {
- try {
- const ws = JSON.parse(json);
- workspaceModel.clear();
- ws.forEach(w => workspaceModel.append({
- wsNum: w.num,
- wsName: w.name,
- wsFocused: w.focused
- }));
- } catch (_) {}
- }
-
- Process {
- id: watcher
- command: ["swaymsg", "-t", "subscribe", "-m", "[\"workspace\"]"]
- running: true
-
- stdout: SplitParser {
- onRead: _ => {
- if (!refresher.running)
- refresher.running = true;
- }
- }
- }
-
- Process {
- id: refresher
- command: ["swaymsg", "-t", "get_workspaces", "-r"]
-
- property string buf: ""
-
- stdout: SplitParser {
- onRead: line => refresher.buf += line
- }
-
- onRunningChanged: {
- if (!running && buf !== "") {
- root.updateWorkspaces(buf);
- buf = "";
- }
- }
-
- Component.onCompleted: running = true
- }
-
- Row {
- id: row
- anchors {
- verticalCenter: parent.verticalCenter
- }
- spacing: 2
-
- Repeater {
- model: workspaceModel
-
- delegate: Rectangle {
- required property int wsNum
- required property string wsName
- required property bool wsFocused
-
- width: 26
- height: 26
- color: wsFocused ? Theme.focus : Theme.transparent
- radius: 3
-
- Text {
- anchors.centerIn: parent
- text: wsNum
- color: Theme.text
- font.pixelSize: 12
- }
-
- Process {
- id: switcher
- command: ["swaymsg", "workspace", "number", wsNum.toString()]
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- switcher.running = false;
- switcher.running = true;
- }
- }
- }
- }
- }
-}