diff options
| author | Rokosun <79040025+futureisfoss@users.noreply.github.com> | 2022-06-24 03:35:02 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-24 03:35:02 +0000 |
| commit | f03efe97d9d01407691a940d8d6703ab82547bc6 (patch) | |
| tree | d7d448ac3fd139c0c563ba04adb414388aab046f | |
| parent | 09ca9e57acf3cbc568842b542379ec57a1184b2e (diff) | |
| download | eibhear-f03efe97d9d01407691a940d8d6703ab82547bc6.tar.gz eibhear-f03efe97d9d01407691a940d8d6703ab82547bc6.tar.zst eibhear-f03efe97d9d01407691a940d8d6703ab82547bc6.zip | |
fix bug in samedir script (#1127)
samedir didn't work properly when the shell was opened inside lf using the w keybinding, now its fixed.
| -rwxr-xr-x | .local/bin/samedir | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/samedir b/.local/bin/samedir index 0a19707..371ec64 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" |
