hypr: migrate runtime IPC calls to the Hyprland 0.56 Lua syntax

Hyprland 0.56 removed the string form of `hyprctl dispatch` and
`hyprctl keyword` entirely: the argument is now evaluated as Lua
(hl.dispatch expects a dispatcher object from hl.dsp.*), and `setprop`
lost the `noborder` property in favour of border_size 0. Everything
that shelled out to these silently broke — wlogout's logout button
did nothing, idle screen-off and lid-close DPMS died, borders stopped
tracking single-window workspaces, and display mirroring was gone.

All callers now use the documented forms: `hyprctl dispatch
"hl.dsp.*"` for dispatchers and `hyprctl eval "hl.monitor(...)"` for
monitor rules. dynamic-borders.sh gets a set_border() helper around
the new window.set_prop dispatcher.

wlogout layouts additionally cannot contain escaped quotes at all:
it parses them with jsmn, which never unescapes strings, so \" used
to reach the shell verbatim and break the command with a syntax
error. Actions now use single quotes only.
This commit is contained in:
Jeena 2026-09-20 14:03:30 +09:00
parent 04371578b6
commit 496fd6fc67
5 changed files with 35 additions and 21 deletions

View file

@ -4,7 +4,7 @@ general {
before_sleep_cmd = loginctl lock-session
# Small delay so the DRM/GPU is ready before re-enabling the display;
# running `dpms on` immediately at resume is the classic cause of a black screen.
after_sleep_cmd = sh -c 'sleep 2; hyprctl dispatch dpms on'
after_sleep_cmd = sh -c "sleep 2; hyprctl dispatch 'hl.dsp.dpms(\"on\")'"
}
# Step 1: Dim monitor at 115 sec idle (warning that it will lock soon)
@ -26,19 +26,19 @@ listener {
# Step 3: Turn screen off at 5 min idle
listener {
timeout = 300
on-timeout = hyprctl dispatch dpms off && ddcutil setvcp 10 0
on-timeout = hyprctl dispatch "hl.dsp.dpms('off')" && ddcutil setvcp 10 0
# Explanation:
# - hyprctl dispatch dpms off → tells the compositor to power off the display (DPMS standby)
# - hl.dsp.dpms("off") → tells the compositor to power off the display (DPMS standby)
# - ddcutil setvcp 10 0 → sets monitor brightness to 0 at the hardware level (safe for OLED)
#
# Both together ensure the screen is fully off visually and electrically
# When the user becomes active again, restore display
on-resume = hyprctl dispatch dpms on && ddcutil setvcp 10 100 && wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
on-resume = hyprctl dispatch "hl.dsp.dpms('on')" && ddcutil setvcp 10 100 && wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
# Explanation:
# - hyprctl dispatch dpms on → ensures the display is powered on by the compositor
# - hl.dsp.dpms("on") → ensures the display is powered on by the compositor
# - ddcutil setvcp 10 100 → restores monitor brightness to full
#
# Both together guarantee the screen wakes reliably on all monitors