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
This commit is contained in:
parent
44d740bd44
commit
cc7ac4619a
1 changed files with 1 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
|
PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
|
||||||
PID="$(pstree -lpA "$PID")"
|
PID="$(pstree -lpA "$PID")"
|
||||||
PID="${PID##*"${SHELL##*/}"(}"
|
PID="${PID##*"${SHELL##*/}"(}"
|
||||||
|
PID="${PID#*lf(}"
|
||||||
PID="${PID%%)*}"
|
PID="${PID%%)*}"
|
||||||
cd "$(readlink /proc/"$PID"/cwd)" || return 1
|
cd "$(readlink /proc/"$PID"/cwd)" || return 1
|
||||||
"$TERMINAL"
|
"$TERMINAL"
|
||||||
|
|
Loading…
Reference in a new issue