summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-30 13:49:05 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-30 13:49:05 +1000
commite8fe4ef673ebb3bc89f192ad5dba0b6d54149f34 (patch)
treee82697134093d7b025c3257a3c6aa49abce483b7 /services
parentbar: custom workspace labels (diff)
downloadcaelestia-shell-e8fe4ef673ebb3bc89f192ad5dba0b6d54149f34.tar.gz
caelestia-shell-e8fe4ef673ebb3bc89f192ad5dba0b6d54149f34.tar.bz2
caelestia-shell-e8fe4ef673ebb3bc89f192ad5dba0b6d54149f34.zip
feat: bar workspaces show windows
Better hyprland clients (update existing instead of resetting every time) Option for ws trail Custom label for occupied ws as well
Diffstat (limited to 'services')
-rw-r--r--services/Hyprland.qml26
1 files changed, 22 insertions, 4 deletions
diff --git a/services/Hyprland.qml b/services/Hyprland.qml
index 336be73..f47c0cb 100644
--- a/services/Hyprland.qml
+++ b/services/Hyprland.qml
@@ -8,12 +8,13 @@ import QtQuick
Singleton {
id: root
- property list<Client> clients: []
+ readonly property list<Client> clients: []
readonly property var workspaces: Hyprland.workspaces
readonly property var monitors: Hyprland.monitors
property Client activeClient: null
readonly property HyprlandWorkspace activeWorkspace: focusedMonitor?.activeWorkspace ?? null
readonly property HyprlandMonitor focusedMonitor: Hyprland.monitors.values.find(m => m.lastIpcObject.focused) ?? null
+ readonly property int activeWsId: activeWorkspace?.id ?? 1
function reload() {
Hyprland.refreshWorkspaces();
@@ -43,9 +44,25 @@ Singleton {
stdout: SplitParser {
onRead: data => {
const clients = JSON.parse(data);
- root.clients = clients.map(c => clientComp.createObject(root, {
- lastIpcObject: c
- })).filter(c => c);
+ const rClients = root.clients;
+
+ const len = rClients.length;
+ for (let i = 0; i < len; i++) {
+ const client = rClients[i];
+ if (!clients.find(c => c.address === client.address))
+ rClients.splice(i, 1);
+ }
+
+ for (const client of clients) {
+ const match = rClients.find(c => c.address === client.address);
+ if (match) {
+ match.lastIpcObject = client;
+ } else {
+ rClients.push(clientComp.createObject(root, {
+ lastIpcObject: client
+ }));
+ }
+ }
}
}
}
@@ -78,6 +95,7 @@ Singleton {
property bool floating: lastIpcObject.floating
property bool fullscreen: lastIpcObject.fullscreen
property int pid: lastIpcObject.pid
+ property int focusHistoryId: lastIpcObject.focusHistoryID
}
Component {