diff options
Diffstat (limited to 'accounts')
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell/Bar.qml | 2 | ||||
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/Bar.qml b/accounts/gkleen@sif/shell/quickshell/Bar.qml index 52f875da..520ec2c6 100644 --- a/accounts/gkleen@sif/shell/quickshell/Bar.qml +++ b/accounts/gkleen@sif/shell/quickshell/Bar.qml | |||
| @@ -356,6 +356,8 @@ PanelWindow { | |||
| 356 | 356 | ||
| 357 | text: { | 357 | text: { |
| 358 | const currentLayout = NiriService.keyboardLayouts?.names?.[NiriService.keyboardLayouts.current_idx]; | 358 | const currentLayout = NiriService.keyboardLayouts?.names?.[NiriService.keyboardLayouts.current_idx]; |
| 359 | if (!currentLayout) | ||
| 360 | return ""; | ||
| 359 | return kbdWidget.keyboardAbbrev[currentLayout] ? kbdWidget.keyboardAbbrev[currentLayout] : currentLayout; | 361 | return kbdWidget.keyboardAbbrev[currentLayout] ? kbdWidget.keyboardAbbrev[currentLayout] : currentLayout; |
| 360 | } | 362 | } |
| 361 | } | 363 | } |
diff --git a/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml b/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml index 914152e1..c82caaa6 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/NiriService.qml | |||
| @@ -13,10 +13,6 @@ Singleton { | |||
| 13 | property var windows: [] | 13 | property var windows: [] |
| 14 | readonly property string socketPath: Quickshell.env("NIRI_SOCKET") | 14 | readonly property string socketPath: Quickshell.env("NIRI_SOCKET") |
| 15 | 15 | ||
| 16 | onKeyboardLayoutsChanged: { | ||
| 17 | console.log(JSON.stringify(keyboardLayouts)); | ||
| 18 | } | ||
| 19 | |||
| 20 | function refreshOutputs() { | 16 | function refreshOutputs() { |
| 21 | commandSocket.sendCommand("Outputs", data => { | 17 | commandSocket.sendCommand("Outputs", data => { |
| 22 | outputs = data.Ok.Outputs; | 18 | outputs = data.Ok.Outputs; |
| @@ -70,6 +66,8 @@ Singleton { | |||
| 70 | eventWindowUrgencyChanged(event.WindowUrgencyChanged); | 66 | eventWindowUrgencyChanged(event.WindowUrgencyChanged); |
| 71 | else if (event.WindowLayoutsChanged) | 67 | else if (event.WindowLayoutsChanged) |
| 72 | eventWindowLayoutsChanged(event.WindowLayoutsChanged); | 68 | eventWindowLayoutsChanged(event.WindowLayoutsChanged); |
| 69 | else | ||
| 70 | console.log(JSON.stringify(event)); | ||
| 73 | } catch (e) { | 71 | } catch (e) { |
| 74 | console.warn("NiriService: Failed to parse event:", line, e) | 72 | console.warn("NiriService: Failed to parse event:", line, e) |
| 75 | } | 73 | } |
| @@ -156,11 +154,7 @@ Singleton { | |||
| 156 | }); | 154 | }); |
| 157 | } | 155 | } |
| 158 | function eventWindowOpenedOrChanged(data) { | 156 | function eventWindowOpenedOrChanged(data) { |
| 159 | root.windows = Array.from(root.windows).map(win => { | 157 | root.windows = Array.from(root.windows).filter(win => win.id !== data.window.id).concat([data.window]); |
| 160 | if (win.id === data.window.id) | ||
| 161 | return data.window; | ||
| 162 | return win; | ||
| 163 | }); | ||
| 164 | } | 158 | } |
| 165 | function eventWindowClosed(data) { | 159 | function eventWindowClosed(data) { |
| 166 | root.windows = Array.from(root.windows).filter(win => win.id !== data.id); | 160 | root.windows = Array.from(root.windows).filter(win => win.id !== data.id); |
