summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif')
-rw-r--r--accounts/gkleen@sif/shell/quickshell/ActiveWindowDisplay.qml2
-rw-r--r--accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml21
-rw-r--r--accounts/gkleen@sif/shell/quickshell/WorkspaceSwitcher.qml2
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 {
11 11
12 property var activeWindow: { 12 property var activeWindow: {
13 let currWindowId = Array.from(NiriService.workspaces).find(ws => { 13 let currWindowId = Array.from(NiriService.workspaces).find(ws => {
14 return ws.output === screen.name && ws.is_active; 14 return ws.output === screen?.name && ws.is_active;
15 })?.active_window_id; 15 })?.active_window_id;
16 16
17 return currWindowId ? Array.from(NiriService.windows).find(win => win.id == currWindowId) : null; 17 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
4import Quickshell 4import Quickshell
5import Quickshell.Io 5import Quickshell.Io
6import Custom as Custom 6import Custom as Custom
7import qs.Services
7 8
8Singleton { 9Singleton {
9 id: root 10 id: root
@@ -72,4 +73,24 @@ Singleton {
72 watchChanges: true 73 watchChanges: true
73 onFileChanged: reload() 74 onFileChanged: reload()
74 } 75 }
76
77
78 Timer {
79 id: startupDelay
80 interval: 500
81 running: true
82 repeat: false
83 }
84 property bool onlyInternal: true
85 Connections {
86 target: NiriService
87 onOutputsChanged: root.onlyInternal = Object.keys(NiriService.outputs).every(oname => oname == "eDP-1")
88 }
89 onOnlyInternalChanged: {
90 if (startupDelay.running)
91 return;
92
93 if (!root.onlyInternal)
94 root.currBrightness = 1
95 }
75} 96}
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 {
20 values: { 20 values: {
21 let currWorkspaces = NiriService.workspaces; 21 let currWorkspaces = NiriService.workspaces;
22 const ignoreWorkspaces = Array.from(workspaces.ignoreWorkspaces); 22 const ignoreWorkspaces = Array.from(workspaces.ignoreWorkspaces);
23 currWorkspaces = currWorkspaces.filter(ws => ws.output == workspaces.screen.name).filter(ws => ws.is_active || ignoreWorkspaces.every(iws => iws !== ws.name)); 23 currWorkspaces = currWorkspaces.filter(ws => ws.output == workspaces.screen?.name).filter(ws => ws.is_active || ignoreWorkspaces.every(iws => iws !== ws.name));
24 currWorkspaces.sort((a, b) => { 24 currWorkspaces.sort((a, b) => {
25 if (NiriService.outputs?.[a.output]?.logical?.x !== NiriService.outputs?.[b.output]?.logical?.x) 25 if (NiriService.outputs?.[a.output]?.logical?.x !== NiriService.outputs?.[b.output]?.logical?.x)
26 return NiriService.outputs?.[a.output]?.logical?.x - NiriService.outputs?.[b.output]?.logical?.x 26 return NiriService.outputs?.[a.output]?.logical?.x - NiriService.outputs?.[b.output]?.logical?.x