From cc7ac4619a698459da2af57bea098f646a2f3d62 Mon Sep 17 00:00:00 2001 From: Rokosun <79040025+futureisfoss@users.noreply.github.com> Date: Sat, 15 Oct 2022 01:25:19 +0000 Subject: [PATCH] Make sd script work with lf file manager too (#1212) 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 371ec64..7e09bf6 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"