mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 08:15:21 +01:00
[GH-ISSUE #426] [Workspace] Workspace name based on the window title and/or class #7171
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#7171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wehagy on GitHub (Jan 29, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/426
Describe the solution you'd like
Workspace name shows some custom string, icon, anything the user wants based on the window class and/or title
Describe alternatives you've considered
Waybar have something similar see https://github.com/Alexays/Waybar/wiki/Module:-Hyprland#window-rewrite-rules
Additional context
You will probably need regex to implement this, the issue for regex is #229
@JakeStanger commented on GitHub (Jan 29, 2024):
It isn't clear to me how this should work - what is the connection between workspaces and windows here?
Could you use an existing program like this to achieve this at the compositor level?
https://github.com/hyprland-community/hyprland-autoname-workspaces
I'd be potentially open to changing the
name_mapconfig option to accepting dynamic strings. I don't think I'd want to add in anything too specific like tying it to current windows though, as that is a lot of work for a niche feature.@wehagy commented on GitHub (Jan 31, 2024):
The name of the workspace changes dynamically according to the name of the windows title and/or class that are open in that workspace, for example:
For context using
ironbar v0.14.0andhyprland-autoname-workspaces 1.1.12, and it doesn't work, it's just a demonstrationworkspace 1have one window, terminal windowworkspace 2have two windows, two firefox windowsworkspace 3have one window, steam windowThe bar now

Close one firefox window

Close the steam window, but the

worskpace 3is active, ignore thenumber 3being theworkspace 1,ironbardon't support, I'll talk more about it laterGo to

workspace 1For this work is need regex to look for the name of the window class and change the workspace name to user defined variable, maybe I think you can't see the icon because of the font:
Thanks, I didn't know about this project, and yes and no, tried and works like a charm in the
waybar, but in thewaybaris builtin, and works too... But maybe I can use for more edge cases, and with theironbarI have some trouble, like you see in the third image above, sorting is "not working", probably because of the alphanumeric sort, the name of the workspaces don't change dynamically, don't remove empty workspaces.Yeah, I don't think a lot of people use this feature, because is cool but is a little bit of pain to setup, and is good if
name_mapaccept dynamic strings, maybe scripts too? To be honest the first thing I tried is to make some script magic, butname_mapdon't accept scripts... And if you support dynamic workspace rename I don't have any reason to use script here.If you don't want to implement this feature builtin, but make
ironbarhappy withhyprland-autoname-workspacesit's nice too.And doing my tests... I discovered that
name_mapdon't acceptPango Markup, if you want I can open a new issue to track this.@JakeStanger commented on GitHub (Feb 3, 2024):
Thanks for taking the time to come back with the extra detail. Here's how I see this:
hyprland-autoname-workspacesis the first step. The fact that doesn't quite work as expected is arguably a bug, so I'd consider that a higher priority.name_mapto be a dynamic string is fairly trivial for a quick winname_mapto accept Pango is also trivial. I'll track that as part of this issue because I might as well do it at the same time as the above.After those are in, we can revisit and see if there's anything else worth adding or if those solve the problem sufficiently.
@xabufr commented on GitHub (Feb 23, 2024):
Hello !
I tried to make some changes to support
hyprland-autoname-workspaces.I managed to get pango syntax in the workspaces name works by this little change:
This permits to have right icons provided by
hyprland-autoname-workspaces, but they don't update. In fact digging into the code I find we didn't listen for workspacerename events.The next challenge is to listen for rename events.
Moreover I think we will need to refactor a little the way we manage those workspace.
Currently we rely a lot on the workspace name (because the event API only send this info), the problem is that the name change with
hyprland-autoname-workspaces:ERROR ironbar::clients::compositor::hyprland: 86: Unable to locate workspace)<sub>1</sub> )@JakeStanger commented on GitHub (Feb 24, 2024):
Thanks for this. I'm looking to enable pango support where possible, which is being tracked in #443 so feel free to open a PR for that. The other info sounds like it should be useful in fixing the issue Yavko linked above.