[GH-ISSUE #942] Ability to sort workspaces by Id #3096

Closed
opened 2026-05-22 23:54:02 +01:00 by JakeStanger · 6 comments
Owner

Originally created by @hattivatt on GitHub (Apr 18, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/942

Is your feature request related to a problem? Please describe.
Currently Workspaces module provides only three variants of sorting Name, Label and Added. None of this options are convenient for people like me, who wants their workspaces always had same order, and also want to name it freely, without any numbers.

Describe the solution you'd like
Implement ability to sort workspaces by workspace_id. Similar to waybar

Originally created by @hattivatt on GitHub (Apr 18, 2025). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/942 **Is your feature request related to a problem? Please describe.** Currently Workspaces module provides only three variants of sorting Name, Label and Added. None of this options are convenient for people like me, who wants their workspaces always had same order, and also want to name it freely, without any numbers. **Describe the solution you'd like** Implement ability to sort workspaces by workspace_id. Similar to waybar
Author
Owner

@JakeStanger commented on GitHub (Apr 18, 2025):

I'm not sure I understand this. Why does the name option not work for you?

It sounds like you're asking to sort on the internal id, which is not consistently the same.

<!-- gh-comment-id:2816038603 --> @JakeStanger commented on GitHub (Apr 18, 2025): I'm not sure I understand this. Why does the `name` option not work for you? It sounds like you're asking to sort on the internal id, which is not consistently the same.
Author
Owner

@hattivatt commented on GitHub (Apr 19, 2025):

Well, I guess it's about internal Id...
I use hyprland and I bind switching between workspaces to number keys. Like Mod + 1 go to workspace 1, Mod + 2 go to workspace 2, etc... And those binds made by workspace ids. And for names I just use hyprland-autoname-workkspaces to make workspace names show icons of apps opened on this workspace.
Right now I'm using waybar and it has option to sort workspaces by id, but now I'm trying to replicate this setup on ironbar and came to this

Basically it looks like this (waybar on top, ironbar lower) for now it's in order (workspaces 1, 2, 3, 9)
Image

But when I want to switch for let's say workspace 6, now empty, waybar put's it correctly between 3 and 9, but ironbar just put it first and that's it
Image

Of course it's not a huge problem, but it feels too weird for me to, considering that I have workspaces binded to number keys and got used to this order.

<!-- gh-comment-id:2816514923 --> @hattivatt commented on GitHub (Apr 19, 2025): Well, I guess it's about internal Id... I use hyprland and I bind switching between workspaces to number keys. Like Mod + 1 go to workspace 1, Mod + 2 go to workspace 2, etc... And those binds made by workspace ids. And for names I just use hyprland-autoname-workkspaces to make workspace names show icons of apps opened on this workspace. Right now I'm using waybar and it has option to sort workspaces by id, but now I'm trying to replicate this setup on ironbar and came to this Basically it looks like this (waybar on top, ironbar lower) for now it's in order (workspaces 1, 2, 3, 9) ![Image](https://github.com/user-attachments/assets/cdb4634e-de8f-4ad4-b210-576b31ad03db) But when I want to switch for let's say workspace 6, now empty, waybar put's it correctly between 3 and 9, but ironbar just put it first and that's it ![Image](https://github.com/user-attachments/assets/ae84fc29-44b3-426c-a1a0-ec3f5610b0c9) Of course it's not a huge problem, but it feels too weird for me to, considering that I have workspaces binded to number keys and got used to this order.
Author
Owner

@JakeStanger commented on GitHub (Apr 19, 2025):

Right, I see the issue.

I don't really like the idea of relying on the IDs, because it is a compositor-specific implementation detail that will only work on Hyprland; Sway and Niri just use the IDs as an internal unique value, and there's no guarantee the same workspace number will always have the same name. That'll change with ext-workspace support again.

I am struggling to see another option though...

I'd be open to adding a sort of "manual" sort option, where you can stick the desired order in the config. Issue is, I can't see how that'd work either because again it needs some sort of identifier.

Any other ideas, I'm open.

<!-- gh-comment-id:2816881169 --> @JakeStanger commented on GitHub (Apr 19, 2025): Right, I see the issue. I don't really like the idea of relying on the IDs, because it is a compositor-specific implementation detail that will only work on Hyprland; Sway and Niri just use the IDs as an internal unique value, and there's no guarantee the same workspace number will always have the same name. That'll change with `ext-workspace` support again. I am struggling to see another option though... I'd be open to adding a sort of "manual" sort option, where you can stick the desired order in the config. Issue is, I can't see how that'd work either because again it needs some sort of identifier. Any other ideas, I'm open.
Author
Owner

@hattivatt commented on GitHub (Apr 20, 2025):

I see, so waybar can do it because it has different workspaces module for different compositors... I can see the problem here, but sadly I'm too don't have any ideas

<!-- gh-comment-id:2817147857 --> @hattivatt commented on GitHub (Apr 20, 2025): I see, so waybar can do it because it has different workspaces module for different compositors... I can see the problem here, but sadly I'm too don't have any ideas
Author
Owner

@deathtrip commented on GitHub (May 21, 2025):

there's no guarantee the same workspace number will always have the same name

Currently even if the workspace name starts with a number, and you select sorting by name, it won't be placed numerically.

When i have a lot of workspaces open and i launch ironbar, it initially sorts them by their number, only the ones opened after that are placed first or last (depending on sorting option). So it looks like there's a way to sort them bu their number right now, just like waybar does it.

<!-- gh-comment-id:2897589784 --> @deathtrip commented on GitHub (May 21, 2025): > there's no guarantee the same workspace number will always have the same name Currently even if the workspace name starts with a number, and you select sorting by name, it won't be placed numerically. When i have a lot of workspaces open and i launch ironbar, it initially sorts them by their number, only the ones opened after that are placed first or last (depending on sorting option). So it looks like there's a way to sort them bu their number right now, just like waybar does it.
Author
Owner

@Deebster commented on GitHub (Nov 27, 2025):

tldr: to support Niri, ironbar needs to have support for ordering by index (not id)


This is a problem in Niri (tested on current head 6caebe287a). You can rename and reorder workspaces, and the order matters as you can navigate between workspaces by going up and down, move columns up and down workspaces, etc.

I had set the order to "added" as it was the only way to get my 1 = comms and 2 = logs to show correctly, but this means that reordering workspaces leads to an incorrect order.

Here you can see that comms is still the first workspace (and I can switch to it with super+1):

$ niri msg workspaces
Output "DP-3":
   1 "comms"
   2 "logs"
   3
 * 4 "test"
   5
   6

I have moved test up and the workspaces have been reindexed:

$ niri msg workspaces
Output "DP-3":
 * 1 "test"
   2 "comms"
   3 "logs"
   4
   5
   6

Test is now index 1 but no sort option will show this without restarting ironbar.

<!-- gh-comment-id:3583901870 --> @Deebster commented on GitHub (Nov 27, 2025): tldr: to support Niri, ironbar needs to have support for ordering by **index** (not id) --- This is a problem in Niri (tested on current head 6caebe287ad95915dd10769c46fb181011f30c57). You can rename and reorder workspaces, and the order matters as you can navigate between workspaces by going up and down, move columns up and down workspaces, etc. I had set the order to "added" as it was the only way to get my 1 = comms and 2 = logs to show correctly, but this means that reordering workspaces leads to an incorrect order. Here you can see that comms is still the first workspace (and I can switch to it with super+1): ``` $ niri msg workspaces Output "DP-3": 1 "comms" 2 "logs" 3 * 4 "test" 5 6 ``` I have moved test up and the workspaces have been reindexed: ``` $ niri msg workspaces Output "DP-3": * 1 "test" 2 "comms" 3 "logs" 4 5 6 ``` Test is now index 1 but no sort option will show this without restarting ironbar.
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#3096
No description provided.