diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-08-24 17:09:55 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:34 -0700 |
| commit | 63b296dff2d4b8eaee8ebdfba7e7128844247bc9 (patch) | |
| tree | f10dd1a2c3646174d81359ad8dc732f83b415cec /config/hypr/scripts | |
| parent | c9dc4744997f9d39e7752373c1b45dc4f57bdca6 (diff) | |
Update Tak0-Autodispatch.sh for LUA
Signed-off-by: Don Williams <don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: config/hypr/scripts/Tak0-Autodispatch.sh
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/Tak0-Autodispatch.sh | 11 |
1 files changed, 7 insertions, 4 deletions
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') |
