Waybar has a dedicated module for Hyprland workspaces: https://github.com/Alexays/Waybar/wiki/Module:-Hyprland#workspaces. One of its most fantastic features is the possibility of representing the application windows in each workspace.
For example, here I have the workspaces with the following application windows:
- Kate (text editor) and terminal (Alacritty)
- Dolphin (file manager)
- A Firefox window and a Firefox window on GitHub
- A Firefox window on YouTube and Thunderbird (email client)
Here’s the Wyabar workspace representation (on the left):
Here I added Google Chrome in the workspace 2:
This is the Waybar module configuration, where the important thing is “{window}” in the “format”. Unfortunately, you must work on defining the rewrite rules and the icon to show as you want. Moreover, these are not icons; they are characters from Nerd fonts:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
"hyprland/workspaces": { "format": "{icon} {windows}", "on-scroll-up": "hyprctl dispatch workspace e+1", "on-scroll-down": "hyprctl dispatch workspace e-1", "on-click": "activate", "window-rewrite-default": "", "window-rewrite": { "title<.*youtube.*>": "", // Windows whose titles contain "youtube" "class<firefox>": "", // Windows whose classes are "firefox" "class<firefox> title<.*github.*>": "", // Windows whose class is "firefox" and title contains "github" "class<firefox> title<.*twitch|youtube.*>": "", "class<google-chrome>": "", "class<google-chrome> title<.*github.*>": "", "class<google-chrome> title<.*twitch|youtube.*>": "", "class<Alacritty>": "", "class<kitty>": "", "class<org.kde.konsole>": "", "code": "", "class<thunderbird>": "", "class<vlc>": "", "class<thunar>": "", "class<org.gnome.Nautilus>": "", "class<org.kde.dolphin>": "", "class<org.kde.kate>": "", "class<libreoffice-draw>": "", "class<libreoffice-writer>": "", "class<libreoffice-calc>": "", "class<libreoffice-impress>": "", }, }, |
Probably, your browser will not render the fonts (though you can copy and paste them, and they will be taken correctly). I’m also showing a screenshot of my text editor where the Nerd fonts are rendered correctly:
Of course, you also have a character to be used by default if nothing matches (e.g., a question mark).
Nice feature, isn’t it? 🙂