From 445f6c2ee0a9a21d4de94dff621279887caa25a4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 5 Mar 2026 09:02:49 +0100 Subject: ... --- .../shell/quickshell/ActiveWindowDisplay.qml | 2 +- .../shell/quickshell/Services/Brightness.qml | 21 +++++++++++++++++++++ .../shell/quickshell/WorkspaceSwitcher.qml | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml b/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml index dcc23279..ac1cbf3a 100644 --- a/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml +++ b/accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml @@ -11,7 +11,7 @@ Item { property var activeWindow: { let currWindowId = Array.from(NiriService.workspaces).find(ws => { - return ws.output === screen.name && ws.is_active; + return ws.output === screen?.name && ws.is_active; })?.active_window_id; return currWindowId ? Array.from(NiriService.windows).find(win => win.id == currWindowId) : null; diff --git a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml index 8318df50..52103c6f 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml @@ -4,6 +4,7 @@ import QtQml import Quickshell import Quickshell.Io import Custom as Custom +import qs.Services Singleton { id: root @@ -72,4 +73,24 @@ Singleton { watchChanges: true onFileChanged: reload() } + + + Timer { + id: startupDelay + interval: 500 + running: true + repeat: false + } + property bool onlyInternal: true + Connections { + target: NiriService + onOutputsChanged: root.onlyInternal = Object.keys(NiriService.outputs).every(oname => oname == "eDP-1") + } + onOnlyInternalChanged: { + if (startupDelay.running) + return; + + if (!root.onlyInternal) + root.currBrightness = 1 + } } diff --git a/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml b/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml index 3ae94346..0dd1bca8 100644 --- a/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml +++ b/accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml @@ -20,7 +20,7 @@ Row { values: { let currWorkspaces = NiriService.workspaces; const ignoreWorkspaces = Array.from(workspaces.ignoreWorkspaces); - currWorkspaces = currWorkspaces.filter(ws => ws.output == workspaces.screen.name).filter(ws => ws.is_active || ignoreWorkspaces.every(iws => iws !== ws.name)); + currWorkspaces = currWorkspaces.filter(ws => ws.output == workspaces.screen?.name).filter(ws => ws.is_active || ignoreWorkspaces.every(iws => iws !== ws.name)); currWorkspaces.sort((a, b) => { if (NiriService.outputs?.[a.output]?.logical?.x !== NiriService.outputs?.[b.output]?.logical?.x) return NiriService.outputs?.[a.output]?.logical?.x - NiriService.outputs?.[b.output]?.logical?.x -- cgit v1.2.3