From a0d08d59da2fe8839b68ea6f41d4bd6fe4f0c9f4 Mon Sep 17 00:00:00 2001 From: Meisterlala <6453306+Meisterlala@users.noreply.github.com> Date: Wed, 13 May 2026 10:27:52 +0000 Subject: [PATCH] refactor(hypr): replace hyprctl dispatch syntax with new hl.dsp API --- dot_config/hypr/executable_screenshot.sh | 14 +++++++++----- dot_config/hypr/executable_thunderbird-toggle.sh | 6 +++--- dot_config/hypr/hypridle.conf | 8 ++++---- dot_config/hypr/hyprland_disabled.conf | 4 ++-- 4 file(s) changed, 18 insertion(s)(+), 14 deletion(s)(-) diff --git a/dot_config/hypr/executable_screenshot.sh b/dot_config/hypr/executable_screenshot.sh --- a/dot_config/hypr/executable_screenshot.sh +++ b/dot_config/hypr/executable_screenshot.sh @@ -8,6 +8,8 @@ year="$(date '+%Y')" month="$(date '+%m')" stamp="$(date '+%Y%m%d-%H%M')" cursor_pos="" +cursor_x="" +cursor_y="" freeze_pid="" watcher_pid="" @@ -27,13 +29,15 @@ hide_cursor() { if command -v hyprctl >/dev/null 2>&1; then cursor_pos="$(hyprctl cursorpos)" - hyprctl dispatch movecursor 99999 99999 >/dev/null 2>&1 || true + cursor_x="${cursor_pos%, *}" + cursor_y="${cursor_pos#*, }" + hyprctl dispatch 'hl.dsp.cursor.move({ x = 99999, y = 99999 })' >/dev/null 2>&1 || true fi } show_cursor() { - if command -v hyprctl >/dev/null 2>&1 && [[ -n "$cursor_pos" ]]; then - hyprctl dispatch movecursor ${cursor_pos//, / } >/dev/null 2>&1 || true + if command -v hyprctl >/dev/null 2>&1 && [[ -n "$cursor_x" && -n "$cursor_y" ]]; then + hyprctl dispatch "hl.dsp.cursor.move({ x = $cursor_x, y = $cursor_y })" >/dev/null 2>&1 || true fi } @@ -49,7 +53,7 @@ kill "$freeze_pid" >/dev/null 2>&1 || true fi if command -v hyprctl >/dev/null 2>&1; then - hyprctl keyword animations:enabled true >/dev/null 2>&1 || true + hyprctl dispatch '(function() hl.config({ animations = { enabled = true } }); return hl.dsp.no_op() end)()' >/dev/null 2>&1 || true fi } trap cleanup EXIT @@ -76,7 +80,7 @@ rawfile="${base_dir}/${stamp}-${suffix}.png" outfile="${base_dir}/${stamp}-${suffix}-satty.png" if command -v hyprctl >/dev/null 2>&1; then - hyprctl keyword animations:enabled false + hyprctl dispatch '(function() hl.config({ animations = { enabled = false } }); return hl.dsp.no_op() end)()' fi if command -v hyprpicker >/dev/null 2>&1; then diff --git a/dot_config/hypr/executable_thunderbird-toggle.sh b/dot_config/hypr/executable_thunderbird-toggle.sh --- a/dot_config/hypr/executable_thunderbird-toggle.sh +++ b/dot_config/hypr/executable_thunderbird-toggle.sh @@ -35,10 +35,10 @@ case "$target" in special:*) target="1" ;; esac - hyprctl dispatch movetoworkspace "$target,address:$address" >/dev/null - hyprctl dispatch focuswindow "address:$address" >/dev/null + hyprctl dispatch "hl.dsp.window.move({ workspace = \"$target\", window = \"address:$address\" })" >/dev/null + hyprctl dispatch "hl.dsp.focus({ window = \"address:$address\" })" >/dev/null else mkdir -p "$state_dir" printf '%s\n' "$workspace" > "$state_file" - hyprctl dispatch movetoworkspacesilent "$hidden_workspace,address:$address" >/dev/null + hyprctl dispatch "hl.dsp.window.move({ workspace = \"$hidden_workspace\", window = \"address:$address\", follow = false })" >/dev/null fi diff --git a/dot_config/hypr/hypridle.conf b/dot_config/hypr/hypridle.conf --- a/dot_config/hypr/hypridle.conf +++ b/dot_config/hypr/hypridle.conf @@ -1,6 +1,6 @@ # exec-once = swayidle -w \ -# timeout 300 'hyprctl dispatch dpms off' \ -# resume 'hyprctl dispatch dpms on' +# timeout 300 'hyprctl dispatch "hl.dsp.dpms({ state = \"off\" })"' \ +# resume 'hyprctl dispatch "hl.dsp.dpms({ state = \"on\" })"' general { lock_cmd = echo lc # dbus/sysd lock command (loginctl lock-session) @@ -14,8 +14,8 @@ } listener { timeout = 600 # in seconds, 600 - on-timeout = hyprctl dispatch dpms off # command to run on timeout - on-resume = hyprctl dispatch dpms on # command to run on resume + on-timeout = hyprctl dispatch "hl.dsp.dpms({ state = \"off\" })" # command to run on timeout + on-resume = hyprctl dispatch "hl.dsp.dpms({ state = \"on\" })" # command to run on resume } listener { diff --git a/dot_config/hypr/hyprland_disabled.conf b/dot_config/hypr/hyprland_disabled.conf --- a/dot_config/hypr/hyprland_disabled.conf +++ b/dot_config/hypr/hyprland_disabled.conf @@ -88,8 +88,8 @@ exec-once = hyprctl plugin load "$HYPR_PLUGIN_DIR/lib/libhyprexpo.so" # Turn off screen after X minutes, Idle # exec-once = swayidle -w \ -# timeout 300 'hyprctl dispatch dpms off' \ -# resume 'hyprctl dispatch dpms on' +# timeout 300 'hyprctl dispatch "hl.dsp.dpms({ state = \"off\" })"' \ +# resume 'hyprctl dispatch "hl.dsp.dpms({ state = \"on\" })"' exec-once = systemctl --user start hypridle.service # User services -- tangled.sh