Hyprland 0.53.0 completely overhauled the windowrule syntax. This breaks pyprland scratchpads because the old format is no longer valid.
Errors seen
FAILED b'invalid field float: missing a value'
FAILED b'invalid field unset: missing a value'
FAILED b'invalid field class:org.coolercontrol.CoolerControl: missing a value'
Cause
Pyprland sends the old syntax:
windowrule float,class:classname
windowrule workspace special:S-name silent,class:classname
Hyprland 0.53.0 requires:
windowrule match:class classname, float on
windowrule match:class classname, workspace special:S-name silent
Workaround
I've patched plugins/scratchpads/__init__.py locally with the following changes:
- Added a new class decorator for 0.53.0+:
def class_decorator_053(name: str) -> str:
"""Return the class rule for hyprland 0.53.0+."""
return f"match:class {name}"
- Updated version detection in
on_reload:
if state.hyprland_version >= VersionInfo(0, 53, 0):
self._classify = class_decorator_053
self._rule_format = "new"
elif state.hyprland_version > VersionInfo(0, 47, 2):
self._classify = class_decorator_new
self._rule_format = "old"
else:
self._classify = class_decorator_old
self._rule_format = "old"
- Updated all windowrule constructions to swap the order for 0.53.0+:
# Old format
f"windowrule float,{self._classify(defined_class)}"
# New format
f"windowrule {self._classify(defined_class)}, float on"
This applies to float, workspace, move, size, and unset rules.
Note: The unset rule still shows an error - I'm not certain of the correct 0.53.0 syntax for unsetting windowrules.
Environment
- Hyprland 0.53.0
- pyprland 2.5.1 (git)
Related
#191
Hyprland 0.53.0 completely overhauled the windowrule syntax. This breaks pyprland scratchpads because the old format is no longer valid.
Errors seen
Cause
Pyprland sends the old syntax:
Hyprland 0.53.0 requires:
Workaround
I've patched
plugins/scratchpads/__init__.pylocally with the following changes:on_reload:This applies to float, workspace, move, size, and unset rules.
Note: The
unsetrule still shows an error - I'm not certain of the correct 0.53.0 syntax for unsetting windowrules.Environment
Related
#191