MaxVerevkin / i3bar-river

A port of i3bar for wlroots-based compositors
GNU General Public License v3.0
35 stars 5 forks source link

Fixed active workspace selection on hyprland with named workspaces #36

Open f-str opened 9 hours ago

f-str commented 9 hours ago

When using hyprland workspaces with default names, e.g. as configured the following in the hyprland config:

workspace = 1, defaultName=A
workspace = 2, defaultName=B
...

These names are then used in the IPC communication instead of the workspace IDs (e.g. workspace>>A, focusedmon>>DP-1,A).

But in the current state, i3bar-river expects the workspace ID to be used in these events, which then is used set the active workspace ID, which leads to the following error invalid digit found in string, as the name could be set to any string.

In my changes the string in the IPC events is used to retrieve the actual workspace ID by filtering the vector of workspaces by the provided name. Note that when no default name is specified in the hyprland config the ID is used a the name, so this does not break.

MaxVerevkin commented 3 hours ago

Thanks, the change looks good to me.

Before merging please run cargo fmt (it turns out the CI check for formatting was not working all this time :laughing:).