[hyprland/workspaces] Implement workspace taskbars - #3868
Conversation
|
@Alexays could you take a look at this PR? |
Add a list of window titles and icons to each workspace (like wlr/taskbar but grouped by workspace). Only implemented on hyprland for now.
Use format from config instead of hardcoding
- orientation - icon-size - icon-theme
This seems to be an old bug that has been made visible with the new workspace taskbars feature. Sometimes, when closing a window and re-opening a window of the same program, hyprland reuses the window address. Since m_orphanWindowMap was not being cleaned up on window close, the new window would not be updated properly.
Fix another older bug where the title of a window will not be updated after moving it to another monitor. In onWindowMoved, when moving an orphan window to the display of the current bar, that window should no longer be an orphan.
Use a vector instead of a map for for storing the workspace windows. This orders the windows by the time they were added to the workspace, instead of sorting by address (which is effectively a random order). The new ordering seems to match the wlr/taskbar module
Windows were not being shown or updated unless the window-rewrite config were present.
- Add missing CSS class to manpage - Fix rare segfault when address is not found (seems to only happen when compiled for production)
|
@Alexays I've been using this feature daily for 2 months and haven't encountered any issues. |
|
@Alexays Please |
|
Thanks for this PR! Is it possible to have such functionality in the improved hyprland/workspaces like this wlr/taskbar config below? |
|
@n-connect "hyprland/workspaces": {
"format": "{icon}: {windows}", // Change to your preferred format
"workspace-taskbar": {
"enable": true,
"format": "{icon} {title:.20}", // Change to your preferred format
"icon-size": 16,
"icon-theme": "Numix-Circle",
"on-click-window": "windowClick.sh {address} {button}"
}
}Where windowClick.sh points to a script like this: #!/bin/bash
address=$1
# https://api.gtkd.org/gdk.c.types.GdkEventButton.button.html
button=$2
if [ $button -eq 1 ]; then
# Left click: focus window. The cursor:no_warps lines are optional.
hyprctl keyword cursor:no_warps true
hyprctl dispatch focuswindow address:$address
hyprctl keyword cursor:no_warps false
elif [ $button -eq 2 ]; then
# Middle click: maximize window
# TODO: Use the corresponding hyprctl dispatch command. I don't know what would 'maximize' mean in a tiling window manager like hyprland
elif [ $button -eq 3 ]; then
# Right click: close window
hyprctl dispatch closewindow address:$address
fi |
|
@n-connect If you want to change the icon that is shown for a specific app, you can do the following:
|
|
Fair enough. Either possibility of getting the same icons as in war/taskbar, or one with your samples above is perfect.
I just need to git magic the latest numbered release, plus your PR into one local copy to do compile it. I hope I can find find my previous notes about cmus and its https stream PR :) |
This PR is already up to date, you can just Also let me know if you are using arch, then it's much easier to install just by modifying the PKGBUILD. |
|
Sorry, I don't understand what you mean. Is there a bug? |
Sorry, short version:
bind = ALT, Tab, cyclenext
bind = ALT, Tab, bringactivetotop
These two above are related to the shellscript you've sent earlier.
This one is a completely generic one. I'll crosscheck with 0.12.0 packaged version if it happens again. |
|
Ah I see. You seem to have a typo on your script: I don't know why the windows are being hidden, this change should not affect it at all. Let me know if it also happens with the 0.12.0 base. |
Which icon pack are you using? |
|
@dinhokusanagi I'm using Tela |
thanks |
|
@n-connect Thanks for the heads-up, I'll have a look later today |
|
@n-connect I updated my branch to the latest upstream commit (0776e69) and reinstalled, and it's still working correctly for me. Looking at the commands you provided, I don't see any |
|
Thank you for the merge, after 5bbace1 , with the same steps (without
|
|
Please take a look on this PR, we are using it since beginning of this year - working well and let have a more tidy, clean smaller footprint Waybar with Hyprland. What do you need to merge this into the mainline? Thx! |
|
Hi all! |
|
No way! We did it!! :) |
|
@Alexays, thanks for the merge! |
|
Hello! First of all, I'd like to thank you for your excellent work developing Waybar and implementing taskbars for workspaces. I have a suggestion that could further improve the user experience: adding the "active-first": true option to the hyprland/workspaces module. This feature would allow the first window of each workspace to be highlighted in the taskbar, making it easier to identify and quickly access active windows. I understand that every change requires analysis and testing, but I believe this addition could benefit many users. 🙏💛 |
|
@dinhokusanagi Let's see if I'm understanding correctly. If |
|
@pol-rivero yes 👍🙂 |
|
Thanks for this feature. I think it would be useful to have a Also if it is possible, when moving windows around it would be nice to have them reorder in the taskbar based on their position. |
|
@dinhokusanagi @schitthub685 Both of your suggestions seem simple enough. I can create a PR when I have some free time. However, keep in mind that the maintainer is not very active and PRs can take a long time to be merged, this one took 7 months.
Unfortunately that's not possible. We don't listen for the window move event, as that would cause tons of redraws. |
thanks |
|
This is a very nice addition to hyprland and thank you for that! As expansion of this feature, I started to wonder if it would be possible to add theme / css support for individual applications when they are hovered? Also, I thought of quite large expansion idea: Would it be possible to display all applications across all windows and workspaces at once. Then have the ability to first group workspaces by monitor, this would create individual groups for each monitor. Then group applications by workspace, this would create individual workspaces inside each monitor group. This way you would have applications inside the workspace they reside in and also the workspaces inside the monitors they reside in. To take this even further, adding drag and drop of applications would be nice. Applications could be dragged from one workspace to another. Additionally, when dragging of application is started, inside each monitor group (or only inside the hovered monitor group) an additional empty workspace could be displayed. This feature would kind of mix the possible workflow of taskbar and workspaces. Interested to hear peoples thoughts. |
I'm not sure I understand what you mean exactly. Do you mean the CSS
If you mean to have each monitor show only its workspaces, that is already de default behavior (see the
Unfortunately, that won't be possible without some massive changes in Waybar. |
|
@dinhokusanagi @schitthub685 This PR implements the changes you requested: #4395 @dinhokusanagi Instead of the |
thanks 🤝 |







Summary
This PR expands the functionality of
hyprland/workspacesto make it behave more like thewlr/taskbarmodule. See #2656 for a high-level description.A full fix of #2656 would require porting those changes to the
sway/workspacesmodule as well. I don't use Sway and I'm not familiar on how it works, but if anyone is interested in giving it a go in a separate PR feel free to ping me and I'll do my best to help.Config changes
Adds the following changes to the
hyprland/workspacesconfig:Notice how
workspace-taskbar.enabledefaults tofalse, so existing configs shouldn't be affected by these changes without opting in.What's missing
I'm mainly waiting for your feedback on the config json names and structure. Once that's done I will update the wiki with the finalized spec.
Screenshots
Old config file (defaults to old, text-based icons). Using default CSS.
New config file (default format is just the icon). Using default CSS.
Example: windows with first 10 chars of title and bigger icon
Tooltip shows full window title.
Allows an arbitrary format
My setup with custom CSS
Same CSS as above, vertical orientation
Action when clicking window
You can use the
on-click-windowconfig to set the command that will be executed when a specific window is clicked.{address}will be replaced with the address of the clicked window.{button}will be replaced with the pressed button number. See GdkEventButton.button.For example:
I personally require a more complex logic, so I use
on-click-windowto call an external script.