From 9b5eb8ab722d78f0ead62a3ed92e220cca46ab76 Mon Sep 17 00:00:00 2001 From: Nydragon Date: Sat, 16 Nov 2024 00:04:20 +0100 Subject: [PATCH] feat: dash ahndles multiple monitors (shitily) --- flake.lock | 6 +++--- src/Dashboard.qml | 2 +- src/Nysh.qml | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 9f401a1..0da9a69 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ ] }, "locked": { - "lastModified": 1731691072, - "narHash": "sha256-ltqP0INiEErk1BVrMyJoH/WEFLYzNG42tL/i5BOP2gw=", + "lastModified": 1731708624, + "narHash": "sha256-23K5I4km7evzYB8tXIzi80Lo33kMcpwVtI3H4IiKk7k=", "owner": "nydragon", "repo": "quickshell", - "rev": "b9a1a6090bc89e5a8214516cac2bd2c32a95d2f1", + "rev": "6ca870d48e1ddb3ae459dda188c2ba9b5213470f", "type": "github" }, "original": { diff --git a/src/Dashboard.qml b/src/Dashboard.qml index 4a0d4e0..37a956d 100644 --- a/src/Dashboard.qml +++ b/src/Dashboard.qml @@ -12,7 +12,7 @@ PanelWindow { id: homeWindow property bool animRunning: false - property bool focused: I3.monitorFor(homeWindow.screen).focused + required property bool focused color: "transparent" visible: (animRunning || NyshState.dashOpen) && focused diff --git a/src/Nysh.qml b/src/Nysh.qml index 5152996..45f389b 100644 --- a/src/Nysh.qml +++ b/src/Nysh.qml @@ -1,5 +1,6 @@ import QtQuick import Quickshell +import Quickshell.I3 Item { id: root @@ -10,7 +11,14 @@ Item { screen: root.screen } + Component.onCompleted: { + I3.focusedMonitorChanged.connect(e => { + dash.focused = I3.monitorFor(root.screen).focused; + }); + } + property Dashboard dash: Dashboard { screen: root.screen + focused: I3.monitorFor(root.screen).focused } }