From 9d4788b6019d8bb1f19a7692149ff978732d99b1 Mon Sep 17 00:00:00 2001 From: Rokosun <79040025+futureisfoss@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:26:55 +0000 Subject: [PATCH] fix bug in samedir script samedir didn't work properly when the shell was opened inside lf using the w keybinding, now its fixed. --- .local/bin/samedir | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/samedir b/.local/bin/samedir index 0a19707e..371ec648 100755 --- a/.local/bin/samedir +++ b/.local/bin/samedir @@ -4,7 +4,7 @@ PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p") PID="$(pstree -lpA "$PID")" -PID="${PID##*(}" -PID="${PID%)}" +PID="${PID##*"${SHELL##*/}"(}" +PID="${PID%%)*}" cd "$(readlink /proc/"$PID"/cwd)" || return 1 "$TERMINAL"