Astal icon indicating copy to clipboard operation
Astal copied to clipboard

Hyprland workspace focus() doesn't work for named workspaces

Open lwukusick opened this issue 1 year ago • 2 comments

When calling Workspace.focus on a workspace that is named (e.g. with workspace=name:my_workspace in hyprland.conf), the workspace with id 1 (and no explicit name) is focused instead. Calling focus on workspaces with no explicit name works as expected.

I believe this is just a matter of incorrectly using the workspace ID instead of the workspace name. Calling Hyprland.get_default().dispatch("workspace", ws.name) myself works as expected, but using ws.id.toString() instead of ws.name produces the same incorrect behavior.

lwukusick avatar Dec 07 '24 17:12 lwukusick

According to the hyprland wiki when using names they have to be prefixed with name: so I'm not sure about dispatch("workspace", ws.name)

Aylur avatar Dec 09 '24 22:12 Aylur

Interesting. Maybe they're more permissive than the spec. Presumably "name:" + ws.name would work then too.

Reading that section, it looks like the issue is that Hyprland is assigning my named workspaces negative IDs, which is explicitly described as disallowed for dispatchers in that bottom orange textbox.

lwukusick avatar Dec 10 '24 00:12 lwukusick