From d545d2c181866edf7070064209c0840df6ef0f45 Mon Sep 17 00:00:00 2001 From: Tilman List Date: Fri, 30 Oct 2020 14:35:20 +0100 Subject: [PATCH] if the $WINDOWID is not set, use xdotool to get the window id --- rc/windowing/repl/x11.kak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc/windowing/repl/x11.kak b/rc/windowing/repl/x11.kak index a9256611..d7e6ed21 100644 --- a/rc/windowing/repl/x11.kak +++ b/rc/windowing/repl/x11.kak @@ -13,8 +13,9 @@ define-command -docstring %{ -params .. \ -shell-completion \ x11-repl %{ x11-terminal sh -c %{ + winid="${WINDOWID:-$(xdotool search --pid ${PPID} | tail -1)}" printf "evaluate-commands -try-client $1 \ - 'set-option current x11_repl_id ${WINDOWID}'" | kak -p "$2" + 'set-option current x11_repl_id ${winid}'" | kak -p "$2" shift 2; [ "$1" ] && "$@" || "$SHELL" } -- %val{client} %val{session} %arg{@}