fix: updated script to use new lua dispatch command for hyprctl

This commit is contained in:
2026-05-31 14:07:36 -04:00
parent a9e520e3da
commit 9e99892555
+5 -5
View File
@@ -26,16 +26,16 @@ fi
client_tty="$( client_tty="$(
tmux list-clients -F '#{client_tty} #{client_termname}' 2>/dev/null \ tmux list-clients -F '#{client_tty} #{client_termname}' 2>/dev/null \
| awk '$2 ~ /ghostty/ { print $1; exit }' || true | awk '$2 ~ /xterm/ { print $1; exit }' || true
)" )"
if [ -n "${client_tty}" ]; then if [ -n "${client_tty}" ]; then
# switch that client to the chosen session # switch that client to the chosen session
tmux switch-client -c "${client_tty}" -t "${chosen}" address=$(hyprctl clients -j | jq -r "to_entries | .[] | select(.value.class == \"foot\") | \"\(.value.address)\"")
address=$(hyprctl clients -j | jq -r "to_entries | .[] | select(.value.class == \"com.mitchellh.ghostty\") | \"\(.value.address)\"")
workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | \"(.workspace.id)\"") workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | \"(.workspace.id)\"")
hyprctl dispatch focusworkspaceoncurrentmonitor "$workspace" hyprctl dispatch "hl.dsp.focus({workspace = $workspace , on_current_monitor = true})"
hyprctl dispatch focuswindow "address:$address" hyprctl dispatch "hl.dsp.focus({ window = \"address:$address\" })"
tmux switch-client -c "${client_tty}" -t "${chosen}"
exit 0 exit 0
fi fi