hyproled v0.1.4 breaks on Hyprland 0.55 without Lua config manager
Hi, thanks for maintaining hyproled.
After updating to hyproled v0.1.4 on Hyprland 0.55.x, OLED protection stopped being applied on my setup.
The command exits successfully, but Hyprland prints:
eval is only supported with the lua config manager
Environment
- hyproled: 0.1.4
- Hyprland: 0.55.x
- Config type: regular hyprlang config (
~/.config/hypr/hyprland.conf), not Lua config manager
Root cause
In v0.1.4, hyproled switches to hyprctl eval based only on the Hyprland minor version:
_HYPR_MINOR=$(hyprctl version 2>/dev/null | grep -oP 'Hyprland 0\.\K[0-9]+')
if (( _HYPR_MINOR >= 55 )); then
_set_shader() { hyprctl eval "hl.config({ decoration = { screen_shader = [[$1]] } })"; }
_clear_shader() { hyprctl eval 'hl.config({ decoration = { screen_shader = "" } })'; }
else
_set_shader() { hyprctl keyword decoration:screen_shader "$1"; }
_clear_shader() { hyprctl keyword decoration:screen_shader ""; }
fi
However, hyprctl eval is only supported when Hyprland is running with the Lua config manager. On a normal hyprlang config, Hyprland 0.55 still rejects it:
eval is only supported with the lua config manager
So the backend selection should probably not depend only on the Hyprland version.
Expected behavior
On Hyprland 0.55 without Lua config manager, hyproled should still use:
hyprctl keyword decoration:screen_shader "$SHADER_FILE"
or otherwise detect whether hyprctl eval is actually supported before using it.
Suggested fix
Instead of selecting eval based only on Hyprland >= 0.55, detect whether hyprctl eval works, and fall back to hyprctl keyword when it does not.
For example, conceptually:
if hyprctl eval 'hl' >/dev/null 2>&1; then
_set_shader() { hyprctl eval "hl.config({ decoration = { screen_shader = [[$1]] } })"; }
_clear_shader() { hyprctl eval 'hl.config({ decoration = { screen_shader = "" } })'; }
else
_set_shader() { hyprctl keyword decoration:screen_shader "$1"; }
_clear_shader() { hyprctl keyword decoration:screen_shader ""; }
fi
A config flag or environment override to force the keyword backend would also solve this.
Thanks!
Thanks for reporting and actively using my tool. Happy to see people with a use case. Fixed in 0.1.5