Skip to content

Add niri-layout-indicator plugin#814

Draft
alnrog wants to merge 16 commits into
noctalia-dev:mainfrom
alnrog:main
Draft

Add niri-layout-indicator plugin#814
alnrog wants to merge 16 commits into
noctalia-dev:mainfrom
alnrog:main

Conversation

@alnrog
Copy link
Copy Markdown

@alnrog alnrog commented May 3, 2026

Adds Niri Layout Indicator plugin.

A native Noctalia Shell bar widget for niri that displays and switches keyboard layouts.

Features:

  • Layout indicator (text / flag)
  • Mouse controls (next / previous / menu)
  • Context menu with layout selection
  • Plugin settings integration

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as duplicate.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

Automatic Code Quality Review


File: plugins/niri-layout-indicator/BarWidget.qml

  • (H) Line 215: Do not use hardcoded values, always prefer to use the Style singleton instead
+            border.width: 1
  • (H) Line 225: Use translations instead of hardcoded text. Instead of: "Example Label". To: pluginApi?.tr("panel.example-label")
+                text: "Keyboard layout"
  • (H) Line 292: Use translations instead of hardcoded text. Instead of: "Example Label". To: pluginApi?.tr("panel.example-label")
+                    text: "Display: " + (root.displayMode === "text" ? "text" : "flag")
  • (H) Line 311: Use translations instead of hardcoded text. Instead of: "Example Label". To: pluginApi?.tr("panel.example-label")
+                    text: "Middle click: " + (root.middleClickAction === "previous" ? "previous layout" : "toggle display")

File: plugins/niri-layout-indicator/Settings.qml

  • (L) Line 61: When it comes to translations there is no need for fallback values. From: pluginApi?.tr("example") || "value". To: pluginApi?.tr("example")
+      return rootItem.pluginApi?.tr(key) || key

@github-actions

This comment was marked as duplicate.

1 similar comment
@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator

@spiros132 spiros132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback about the PR! :D


```bash
mkdir -p ~/.config/noctalia/plugins
cp -r niri-layout-indicator ~/.config/noctalia/plugins/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section isn't correct since the user can install the plugin just by pressing install.

### Quick install

```bash
./install.sh
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't correct either since there is no ./install.sh script and there shouldn't be any


property var pluginApi: null

Timer {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this timer needed in the first place?

Layout.preferredWidth: 600
Layout.preferredHeight: 0
visible: false
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Item to enforce minimum width shouldn't be needed.

@spiros132 spiros132 marked this pull request as draft May 10, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants