From 63b296dff2d4b8eaee8ebdfba7e7128844247bc9 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 24 Aug 2026 17:09:55 -0400 Subject: Update Tak0-Autodispatch.sh for LUA Signed-off-by: Don Williams On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/scripts/Tak0-Autodispatch.sh --- config/hypr/scripts/Tak0-Autodispatch.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/hypr/scripts/Tak0-Autodispatch.sh b/config/hypr/scripts/Tak0-Autodispatch.sh index 8eea93ad..3f6da3d1 100755 --- a/config/hypr/scripts/Tak0-Autodispatch.sh +++ b/config/hypr/scripts/Tak0-Autodispatch.sh @@ -144,7 +144,7 @@ for RULE in "${CAPTURE_RULES[@]}"; do if [[ "$hypr_config_mode" == "lua" ]]; then # Attempt to parse rule string into Lua table if it matches class:pattern if [[ "$RULE" =~ class:\^\((.*)\)\$ ]]; then - local class_pat="${BASH_REMATCH[1]}" + class_pat="${BASH_REMATCH[1]}" hyprctl eval "hl.window_rule({ name = 'autodispatch-$class_pat', match = { class = '$class_pat' }, workspace = '$TARGET_WS' })" >>"$LOGFILE" 2>&1 || true fi else @@ -251,9 +251,12 @@ while ((SECONDS < END_TIME)); do if ((MATCH)) && [[ -z "${SEEN[$ADDR]-}" ]]; then echo "Placing window $ADDR (pid $PID, class $CLASS) → WS $TARGET_WS" >>"$LOGFILE" - # Dispatch works the same in both modes - hyprctl dispatch movetoworkspacesilent \ - "$TARGET_WS,address:$ADDR" >>"$LOGFILE" 2>&1 || true + if [[ "$hypr_config_mode" == "lua" ]]; then + hyprctl eval "return hl.dispatch(hl.dsp.window.move({ workspace = '$TARGET_WS', follow = false, window = 'address:$ADDR' }))" >>"$LOGFILE" 2>&1 || true + else + hyprctl dispatch movetoworkspacesilent \ + "$TARGET_WS,address:$ADDR" >>"$LOGFILE" 2>&1 || true + fi SEEN[$ADDR]=1 fi done < <(hyprctl clients -j | jq -r '.[] | [.pid, .address, .class] | @tsv') -- cgit v1.2.3