#!/usr/bin/env bash # Open file in $EDITOR using tmux for tridactyl. # Uses wait-for to make the process blocking. # $1 is the temporary file, $2 is the line number and $3 is the column number. # The browser window id is saved and reactivated as the editing is finished. browser_window="$(xdotool getactivewindow)" wait_for="tridactyl-$(basename "$1")" # The name used in tmux's wait-for tmux_cmd_dmenu '' "${EDITOR:-nvim} $(printf %q "$1") '+normal!$2Gzv$3|'; tmux wait-for -S $(printf %q "$wait_for")" tmux wait-for "$wait_for" xdotool windowactivate "$browser_window"