feat: Ability to use icons for empty workspace.#58
Conversation
8906afc to
45ec4e9
Compare
This allows users of ex. `waybar` to use dynamic icons, while still giving empty workspaces an icon instead of a number. This is implemented by renaming new workspaces right when they are created. This is all behind a config option; defaults remain unchanged. Implementing this is also an optimization for the rest of the program, which no longer recalculates workspace naming on _every_ `Event::Window`. Instead, only specific `Window` (and now also `Workspace`) events will do so. **Caveats**: - There is a small visual artifact when opening a new workspace, when the number gets renamed to the desired icon.. Unfortunately, being a program reacting to sway events, I don't see a way to fix this. **Future Possibilities**: - Allowing specific icons for specific numbered (empty) workspaces wouldn't be difficult to add (which would close #33). - Which `*.change` types precisely should trigger workspace renaming was determined with common sense, and could do with a one-over. The relevant function is `should_rename_after_event`. Closes #39.
|
Hi @so-rose 👋 I think this should be logically equivalent to the previous code in #42. Originally, I tried to move the part where we listen for events before displaying anything because that means that when we start workstyle, we don't refresh workspaces the first time. That can be fixed differently by refreshing before entering the loop, so needs to be addressed before we merge this, but not a major issue. I played with it in hyprland (waybar doesn't have persistent workspaces for it yet, but there is a PR up so that should happen soon) and sway trying to find some settings between waybar, workstyle and sway that make persistent workspaces work with this. My attempts revolved around this bit of waybar config or something along those lines From my testing, this is a bit of a step in the right direction, but the behaviour is really buggy and unpredictable. Am I missing something? @so-rose, could you share the config settings you have in mind for sway + waybar + workstyle that would make it work? It could also be that I butchered something in the rebase. Also, I've been playing with it on multiple monitors to try and catch more potential edge-cases, but I'm also seeing many buggy behaviours on a single monitor. |
This allows users of ex.
waybarto use dynamic icons, while still giving empty workspaces an icon instead of a number. This is implemented by renaming new workspaces right when they are created.This is all behind a config option; defaults remain unchanged.
Implementing this is also an optimization for the rest of the program, which no longer recalculates workspace naming on every
Event::Window. Instead, only specificWindow(and now alsoWorkspace) events will do so.Caveats:
Future Possibilities:
*.changetypes precisely should trigger workspace renaming was determined with common sense, and could do with a one-over. The relevant function isshould_rename_after_event.Closes #39.