From 4080286c4df97bddc3362f89905ef44035164383 Mon Sep 17 00:00:00 2001 From: Adam0 Date: Sun, 5 Jul 2026 23:39:54 +0200 Subject: [PATCH] maintain this project a bit --- README.md | 6 +++ flake.lock | 22 +++++++++++ flake.nix | 5 +++ modules/overview/Overview.qml | 11 ++++-- modules/overview/OverviewWidget.qml | 1 - nix/parts/exports.nix | 11 ++++-- services/HyprlandData.qml | 59 ++++------------------------- shell.qml | 1 + 8 files changed, 56 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index d81985e..8936b6e 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,12 @@ overzicht ipc call overview open overzicht ipc call overview close ``` +When running directly from the flake, pass IPC arguments after `--`: + +```bash +nix run .#overzicht -- ipc call overview toggle +``` + Keyboard controls while the overview is open: - `Left` / `Right` / `Up` / `Down` move across the visible grid. diff --git a/flake.lock b/flake.lock index 92a1f1a..f5c9222 100644 --- a/flake.lock +++ b/flake.lock @@ -80,11 +80,33 @@ "type": "github" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1777871389, + "narHash": "sha256-gU+VGpwGJ2vvg0mtYqVvj5u+2LteuHlpokH6JSAtueY=", + "ref": "refs/tags/v0.3.0", + "rev": "59e9c47b0eb48a9e4bcf9631fa062ee939bd2e83", + "revCount": 815, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "ref": "refs/tags/v0.3.0", + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, "root": { "inputs": { "flake-parts": "flake-parts", "import-tree": "import-tree", "nixpkgs": "nixpkgs", + "quickshell": "quickshell", "systems": "systems", "treefmt-nix": "treefmt-nix" } diff --git a/flake.nix b/flake.nix index 3b6c4fa..f2e7701 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,11 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + quickshell = { + inputs.nixpkgs.follows = "nixpkgs"; + url = "git+https://git.outfoxxed.me/outfoxxed/quickshell?ref=refs/tags/v0.3.0"; + }; + systems.url = "github:nix-systems/default"; treefmt-nix.url = "github:numtide/treefmt-nix"; diff --git a/modules/overview/Overview.qml b/modules/overview/Overview.qml index 6d271f1..d5d9aff 100644 --- a/modules/overview/Overview.qml +++ b/modules/overview/Overview.qml @@ -201,7 +201,7 @@ Scope { Loader { id: overviewLoader - active: Config?.options.overview.enable ?? true + active: (Config?.options.overview.enable ?? true) && GlobalStates.overviewOpen sourceComponent: OverviewWidget { panelWindow: root visible: true @@ -214,14 +214,17 @@ Scope { IpcHandler { target: "overview" - function toggle() { + function toggle(): void { GlobalStates.overviewOpen = !GlobalStates.overviewOpen; } - function close() { + function close(): void { GlobalStates.overviewOpen = false; } - function open() { + function open(): void { GlobalStates.overviewOpen = true; } + function isOpen(): bool { + return GlobalStates.overviewOpen; + } } } diff --git a/modules/overview/OverviewWidget.qml b/modules/overview/OverviewWidget.qml index 4224244..b73516e 100644 --- a/modules/overview/OverviewWidget.qml +++ b/modules/overview/OverviewWidget.qml @@ -24,7 +24,6 @@ Item { property bool monitorIsFocused: Hyprland.focusedMonitor?.name == monitor.name property var windows: HyprlandData.windowList property var windowByAddress: HyprlandData.windowByAddress - property var windowAddresses: HyprlandData.addresses property var monitorData: HyprlandData.monitors.find(m => m.id === root.monitor?.id) property real scale: Config.options.overview.scale property color activeBorderColor: Appearance.colors.colSecondary diff --git a/nix/parts/exports.nix b/nix/parts/exports.nix index 7dd6902..1865c29 100644 --- a/nix/parts/exports.nix +++ b/nix/parts/exports.nix @@ -1,7 +1,9 @@ -_: { +{inputs, ...}: { flake = { overlays.default = final: _: { - overzicht = final.callPackage ../package.nix {}; + overzicht = final.callPackage ../package.nix { + quickshell = inputs.quickshell.packages.${final.system}.default; + }; }; # keep-sorted start @@ -14,13 +16,16 @@ _: { # keep-sorted start config, pkgs, + system, # keep-sorted end ... }: { packages = { # keep-sorted start default = config.packages.overzicht; - overzicht = pkgs.callPackage ../package.nix {}; + overzicht = pkgs.callPackage ../package.nix { + quickshell = inputs.quickshell.packages.${system}.default; + }; # keep-sorted end }; }; diff --git a/services/HyprlandData.qml b/services/HyprlandData.qml index aa333d1..ac8595b 100644 --- a/services/HyprlandData.qml +++ b/services/HyprlandData.qml @@ -13,46 +13,33 @@ import "../common" Singleton { id: root property var windowList: [] - property var addresses: [] property var windowByAddress: ({}) property var workspaces: [] - property var workspaceIds: [] property var workspaceById: ({}) - property var activeWorkspace: null property var monitors: [] - property var layers: ({}) property bool pendingWindowsUpdate: false property bool pendingMonitorsUpdate: false - property bool pendingLayersUpdate: false property bool pendingWorkspacesUpdate: false - property bool pendingActiveWorkspaceUpdate: false function updateWindowList() { getClients.running = true; } - function updateLayers() { - getLayers.running = true; - } - function updateMonitors() { getMonitors.running = true; } function updateWorkspaces() { getWorkspaces.running = true; - getActiveWorkspace.running = true; } function updateAll() { - scheduleUpdates(true, true, true, true, true); + scheduleUpdates(true, true, true); } - function scheduleUpdates(windows, monitors, layers, workspaces, activeWorkspace) { + function scheduleUpdates(windows, monitors, workspaces) { pendingWindowsUpdate = pendingWindowsUpdate || !!windows; pendingMonitorsUpdate = pendingMonitorsUpdate || !!monitors; - pendingLayersUpdate = pendingLayersUpdate || !!layers; pendingWorkspacesUpdate = pendingWorkspacesUpdate || !!workspaces; - pendingActiveWorkspaceUpdate = pendingActiveWorkspaceUpdate || !!activeWorkspace; const debounceMs = Math.max(0, Config.options.hacks.hyprlandEventDebounceMs); if (debounceMs === 0) { @@ -72,18 +59,10 @@ Singleton { pendingMonitorsUpdate = false; updateMonitors(); } - if (pendingLayersUpdate) { - pendingLayersUpdate = false; - updateLayers(); - } if (pendingWorkspacesUpdate) { pendingWorkspacesUpdate = false; getWorkspaces.running = true; } - if (pendingActiveWorkspaceUpdate) { - pendingActiveWorkspaceUpdate = false; - getActiveWorkspace.running = true; - } } function biggestWindowForWorkspace(workspaceId) { @@ -96,7 +75,7 @@ Singleton { } Component.onCompleted: { - scheduleUpdates(true, true, true, true, true); + scheduleUpdates(true, true, true); flushPendingUpdates(); } @@ -109,21 +88,21 @@ Singleton { return; if (eventName === "openwindow" || eventName === "closewindow" || eventName === "movewindow" || eventName === "movewindowv2" || eventName === "windowtitle") { - scheduleUpdates(true, false, false, true, false); + scheduleUpdates(true, false, true); return; } if (eventName === "workspace" || eventName === "workspacev2" || eventName === "focusedmon" || eventName === "focusedmonv2" || eventName === "activewindow" || eventName === "activewindowv2") { - scheduleUpdates(false, false, false, true, true); + scheduleUpdates(false, false, true); return; } if (eventName.startsWith("monitor") || eventName === "configreloaded") { - scheduleUpdates(true, true, false, true, true); + scheduleUpdates(true, true, true); return; } - scheduleUpdates(true, true, true, true, true); + scheduleUpdates(true, true, true); } } @@ -147,7 +126,6 @@ Singleton { tempWinByAddress[win.address] = win; } root.windowByAddress = tempWinByAddress; - root.addresses = root.windowList.map(win => win.address); } } } @@ -163,17 +141,6 @@ Singleton { } } - Process { - id: getLayers - command: ["hyprctl", "layers", "-j"] - stdout: StdioCollector { - id: layersCollector - onStreamFinished: { - root.layers = JSON.parse(layersCollector.text); - } - } - } - Process { id: getWorkspaces command: ["hyprctl", "workspaces", "-j"] @@ -187,18 +154,6 @@ Singleton { tempWorkspaceById[ws.id] = ws; } root.workspaceById = tempWorkspaceById; - root.workspaceIds = root.workspaces.map(ws => ws.id); - } - } - } - - Process { - id: getActiveWorkspace - command: ["hyprctl", "activeworkspace", "-j"] - stdout: StdioCollector { - id: activeWorkspaceCollector - onStreamFinished: { - root.activeWorkspace = JSON.parse(activeWorkspaceCollector.text); } } } diff --git a/shell.qml b/shell.qml index e92b4eb..bc954e1 100644 --- a/shell.qml +++ b/shell.qml @@ -1,5 +1,6 @@ //@ pragma UseQApplication //@ pragma Env QT_QUICK_CONTROLS_STYLE=Basic +//@ pragma ShellId overzicht import "./modules/overview/" import "./services/" -- 2.51.2