hyprland-community/pyprland

[BUG] Fail to parse hyprctl version on Hyprland built from git

Closed this issue · 1 comments

Pyprland version
2.2.11

Describe the bug
When using Hyprland built from the git repo (i.e. not a tagged release), pypr shows a Fail to parse hyprctl version error notification message on startup.

In the output of hyprctl -j version, the tag property is v0.39.1-59-ga2366f78 for me, so I believe this

try:
state.hyprland_version = VersionInfo(
*(int(i) for i in version[1:].split(".")[:3])
)
except Exception as e: # pylint: disable=broad-except
self.log.error("Fail to parse hyprctl version: %s", e)
await self.notify_error("Fail to parse hyprctl version")
state.hyprland_version = VersionInfo(0, 0, 0)

just needs to discard the potential suffix before doing split(".").

Thank you for this report! I'll take care of it soon!