diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-01 14:05:25 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-01 14:05:25 +0200 |
commit | c9b4c6834e390f051e3137a6a45882ea8608ee9d (patch) | |
tree | 98229a1b688b09653fbd82e45a9471e1b033233d | |
parent | 466ce70f96f8bdde32260f6951c5cbb62cfc02a7 (diff) | |
download | nixos-c9b4c6834e390f051e3137a6a45882ea8608ee9d.tar nixos-c9b4c6834e390f051e3137a6a45882ea8608ee9d.tar.gz nixos-c9b4c6834e390f051e3137a6a45882ea8608ee9d.tar.bz2 nixos-c9b4c6834e390f051e3137a6a45882ea8608ee9d.tar.xz nixos-c9b4c6834e390f051e3137a6a45882ea8608ee9d.zip |
...
4 files changed, 52 insertions, 44 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/Clock.qml b/accounts/gkleen@sif/shell/quickshell/Clock.qml index 58600adb..55fabd1c 100644 --- a/accounts/gkleen@sif/shell/quickshell/Clock.qml +++ b/accounts/gkleen@sif/shell/quickshell/Clock.qml | |||
@@ -11,7 +11,7 @@ Item { | |||
11 | height: parent.height | 11 | height: parent.height |
12 | anchors.verticalCenter: parent.verticalCenter | 12 | anchors.verticalCenter: parent.verticalCenter |
13 | 13 | ||
14 | MouseArea { | 14 | WrapperMouseArea { |
15 | id: clockMouseArea | 15 | id: clockMouseArea |
16 | 16 | ||
17 | anchors.fill: parent | 17 | anchors.fill: parent |
@@ -29,24 +29,24 @@ Item { | |||
29 | } | 29 | } |
30 | 30 | ||
31 | onWheel: event => scrollYear(event) | 31 | onWheel: event => scrollYear(event) |
32 | } | ||
33 | 32 | ||
34 | Text { | 33 | Text { |
35 | id: clock | 34 | id: clock |
36 | color: "white" | 35 | color: "white" |
37 | 36 | ||
38 | anchors.verticalCenter: parent.verticalCenter | 37 | anchors.verticalCenter: parent.verticalCenter |
39 | 38 | ||
40 | Custom.Chrono { | 39 | Custom.Chrono { |
41 | id: chrono | 40 | id: chrono |
42 | format: "W{0:%V-%u} {0:%F} {0:%H:%M:%S%Ez}" | 41 | format: "W{0:%V-%u} {0:%F} {0:%H:%M:%S%Ez}" |
43 | } | 42 | } |
44 | 43 | ||
45 | text: chrono.date | 44 | text: chrono.date |
46 | 45 | ||
47 | font.pointSize: 10 | 46 | font.pointSize: 10 |
48 | font.family: "Fira Sans" | 47 | font.family: "Fira Sans" |
49 | font.features: { "tnum": 1 } | 48 | font.features: { "tnum": 1 } |
49 | } | ||
50 | } | 50 | } |
51 | 51 | ||
52 | PopupWindow { | 52 | PopupWindow { |
@@ -250,4 +250,4 @@ Item { | |||
250 | } | 250 | } |
251 | } | 251 | } |
252 | } | 252 | } |
253 | } \ No newline at end of file | 253 | } |
diff --git a/accounts/gkleen@sif/shell/quickshell/KeyboardLayout.qml b/accounts/gkleen@sif/shell/quickshell/KeyboardLayout.qml index b9f91580..4a6b8390 100644 --- a/accounts/gkleen@sif/shell/quickshell/KeyboardLayout.qml +++ b/accounts/gkleen@sif/shell/quickshell/KeyboardLayout.qml | |||
@@ -18,7 +18,7 @@ Rectangle { | |||
18 | height: parent.height | 18 | height: parent.height |
19 | anchors.verticalCenter: parent.verticalCenter | 19 | anchors.verticalCenter: parent.verticalCenter |
20 | 20 | ||
21 | MouseArea { | 21 | WrapperMouseArea { |
22 | id: kbdMouseArea | 22 | id: kbdMouseArea |
23 | 23 | ||
24 | anchors.fill: parent | 24 | anchors.fill: parent |
@@ -31,25 +31,25 @@ Rectangle { | |||
31 | onWheel: event => { | 31 | onWheel: event => { |
32 | NiriService.sendCommand({ "Action": { "SwitchLayout": { "layout": event.angleDelta > 0 ? "Next" : "Prev" } } }, _ => {}) | 32 | NiriService.sendCommand({ "Action": { "SwitchLayout": { "layout": event.angleDelta > 0 ? "Next" : "Prev" } } }, _ => {}) |
33 | } | 33 | } |
34 | } | ||
35 | 34 | ||
36 | Text { | 35 | Text { |
37 | id: kbdLabel | 36 | id: kbdLabel |
38 | 37 | ||
39 | font.pointSize: 10 | 38 | font.pointSize: 10 |
40 | font.family: "Fira Sans" | 39 | font.family: "Fira Sans" |
41 | color: { | 40 | color: { |
42 | if (NiriService.keyboardLayouts?.current_idx === 0) | 41 | if (NiriService.keyboardLayouts?.current_idx === 0) |
43 | return "#555"; | 42 | return "#555"; |
44 | return "white"; | 43 | return "white"; |
45 | } | 44 | } |
46 | anchors.centerIn: parent | 45 | anchors.centerIn: parent |
47 | 46 | ||
48 | text: { | 47 | text: { |
49 | const currentLayout = NiriService.keyboardLayouts?.names?.[NiriService.keyboardLayouts.current_idx]; | 48 | const currentLayout = NiriService.keyboardLayouts?.names?.[NiriService.keyboardLayouts.current_idx]; |
50 | if (!currentLayout) | 49 | if (!currentLayout) |
51 | return ""; | 50 | return ""; |
52 | return kbdWidget.keyboardAbbrev[currentLayout] ? kbdWidget.keyboardAbbrev[currentLayout] : currentLayout; | 51 | return kbdWidget.keyboardAbbrev[currentLayout] ? kbdWidget.keyboardAbbrev[currentLayout] : currentLayout; |
52 | } | ||
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml b/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml index c82caaa6..179b55e0 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml | |||
@@ -28,9 +28,12 @@ Singleton { | |||
28 | path: root.socketPath | 28 | path: root.socketPath |
29 | connected: true | 29 | connected: true |
30 | 30 | ||
31 | property bool acked: false | ||
32 | |||
31 | onConnectionStateChanged: { | 33 | onConnectionStateChanged: { |
32 | if (connected) { | 34 | if (connected) { |
33 | write('"EventStream"\n') | 35 | acked = false; |
36 | write('"EventStream"\n'); | ||
34 | } | 37 | } |
35 | } | 38 | } |
36 | 39 | ||
@@ -66,6 +69,9 @@ Singleton { | |||
66 | eventWindowUrgencyChanged(event.WindowUrgencyChanged); | 69 | eventWindowUrgencyChanged(event.WindowUrgencyChanged); |
67 | else if (event.WindowLayoutsChanged) | 70 | else if (event.WindowLayoutsChanged) |
68 | eventWindowLayoutsChanged(event.WindowLayoutsChanged); | 71 | eventWindowLayoutsChanged(event.WindowLayoutsChanged); |
72 | else if (event.Ok && !eventStreamSocket.acked) { eventStreamSocket.acked = true; } | ||
73 | else if (event.OverviewOpenedOrClosed) {} | ||
74 | else if (event.ConfigLoaded) {} | ||
69 | else | 75 | else |
70 | console.log(JSON.stringify(event)); | 76 | console.log(JSON.stringify(event)); |
71 | } catch (e) { | 77 | } catch (e) { |
diff --git a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml index ba678138..024026a3 100644 --- a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml +++ b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml | |||
@@ -24,6 +24,8 @@ Item { | |||
24 | } | 24 | } |
25 | 25 | ||
26 | delegate: Item { | 26 | delegate: Item { |
27 | id: trayItemWrapper | ||
28 | |||
27 | property var trayItem: modelData | 29 | property var trayItem: modelData |
28 | property string iconSource: { | 30 | property string iconSource: { |
29 | let icon = trayItem && trayItem.icon | 31 | let icon = trayItem && trayItem.icon |
@@ -47,17 +49,7 @@ Item { | |||
47 | height: parent.height | 49 | height: parent.height |
48 | anchors.verticalCenter: parent.verticalCenter | 50 | anchors.verticalCenter: parent.verticalCenter |
49 | 51 | ||
50 | IconImage { | 52 | WrapperMouseArea { |
51 | anchors.centerIn: parent | ||
52 | width: parent.width | ||
53 | height: parent.width | ||
54 | source: parent.iconSource | ||
55 | asynchronous: true | ||
56 | smooth: true | ||
57 | mipmap: true | ||
58 | } | ||
59 | |||
60 | MouseArea { | ||
61 | id: trayItemArea | 53 | id: trayItemArea |
62 | 54 | ||
63 | anchors.fill: parent | 55 | anchors.fill: parent |
@@ -88,6 +80,16 @@ Item { | |||
88 | menuAnchor.open() | 80 | menuAnchor.open() |
89 | } | 81 | } |
90 | } | 82 | } |
83 | |||
84 | IconImage { | ||
85 | anchors.centerIn: parent | ||
86 | width: parent.width | ||
87 | height: parent.width | ||
88 | source: trayItemWrapper.iconSource | ||
89 | asynchronous: true | ||
90 | smooth: true | ||
91 | mipmap: true | ||
92 | } | ||
91 | } | 93 | } |
92 | 94 | ||
93 | PopupWindow { | 95 | PopupWindow { |