From 221946587f29b32bc5b73a6bd3cb794a2194adee Mon Sep 17 00:00:00 2001 From: Rokosun <79040025+futureisfoss@users.noreply.github.com> Date: Mon, 10 Oct 2022 10:34:21 +0000 Subject: [PATCH] Make sd script work with lf file manager too Now sd script can open a terminal window in the same directory as the currently active lf file manager window --- .local/bin/sd | 1 + 1 file changed, 1 insertion(+) diff --git a/.local/bin/sd b/.local/bin/sd index 371ec648..7e09bf6e 100755 --- a/.local/bin/sd +++ b/.local/bin/sd @@ -5,6 +5,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##*"${SHELL##*/}"(}" +PID="${PID#*lf(}" PID="${PID%%)*}" cd "$(readlink /proc/"$PID"/cwd)" || return 1 "$TERMINAL"