[PR #911] [MERGED] refactor: sort niri workspaces before WorkspaceUpdate::Init #9463

Closed
opened 2026-05-23 03:56:39 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/ironbar/pull/911
Author: @MapoMagpie
Created: 3/24/2025
Status: Merged
Merged: 3/24/2025
Merged by: @JakeStanger

Base: masterHead: ordered_niri_workspace


📝 Commits (2)

  • 749c643 refactor: sort niri workspaces before init
  • c485d5c chore: comment for ordered_niri_workspace changing

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 src/clients/compositor/niri/mod.rs (+5 -1)

📄 Description

Niri has a "Named Workspaces" feature,
where Workspace's id are assigned based on the order declared in the configuration file.

However, when Ironbar initializes, the WorkspacesChanged event output by Niri is not sorted by ID. As a result, even when I declare sort = "added" in Ironbar's configuration file, the final sorting remains inconsistent.

To achieve the expected behavior, we simply need to sort new_workspaces by ID before initializing workspaces in Ironbar. This change will not affect the original functionality.

This is my ironbar workspaces configuration

[[start]]
type = "workspaces"
sort = "added"
[start.name_map]
NETW = " NETW  "
TERM = " TERM  "
CODE = " CODE  "
CHAT = " CHAT  "
GAME = " GAME  "
6 = " TEMP  "

Before change
grim_20250324_210020
After change
grim_20250324_210036


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/ironbar/pull/911 **Author:** [@MapoMagpie](https://github.com/MapoMagpie) **Created:** 3/24/2025 **Status:** ✅ Merged **Merged:** 3/24/2025 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `ordered_niri_workspace` --- ### 📝 Commits (2) - [`749c643`](https://github.com/JakeStanger/ironbar/commit/749c64337c2006cac745c2af904abbd6904b3744) refactor: sort niri workspaces before init - [`c485d5c`](https://github.com/JakeStanger/ironbar/commit/c485d5cd37589720e9390d2236031e622803c085) chore: comment for ordered_niri_workspace changing ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/clients/compositor/niri/mod.rs` (+5 -1) </details> ### 📄 Description Niri has a "[Named Workspaces](https://github.com/YaLTeR/niri/wiki/Configuration:-Named-Workspaces)" feature, where Workspace's id are assigned based on the order declared in the configuration file. However, when Ironbar initializes, the WorkspacesChanged event output by Niri is not sorted by ID. As a result, even when I declare `sort = "added"` in Ironbar's configuration file, the final sorting remains inconsistent. To achieve the expected behavior, we simply need to sort new_workspaces by ID before initializing workspaces in Ironbar. This change will not affect the original functionality. This is my ironbar workspaces configuration ``` [[start]] type = "workspaces" sort = "added" [start.name_map] NETW = " NETW  " TERM = " TERM  " CODE = " CODE  " CHAT = " CHAT  " GAME = " GAME  " 6 = " TEMP  " ``` Before change ![grim_20250324_210020](https://github.com/user-attachments/assets/63788beb-26af-4783-9c88-4a812796fdd6) After change ![grim_20250324_210036](https://github.com/user-attachments/assets/c71cc251-f919-484f-8c7f-449f8c233005) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-23 03:56:39 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#9463
No description provided.