dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 2acedd3517ed52e1861e21d01945d8b16dfc163e
parent b085acedb0a2beb64ffd01dfb664fc8be7589795
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sun,  8 Mar 2020 18:23:38 -0400

samedir tweak

Diffstat:
M.local/bin/samedir | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.local/bin/samedir b/.local/bin/samedir @@ -1,6 +1,8 @@ #!/bin/sh +# Open a terminal window in the same directory as the currently active window. + PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) -PID=$(echo "$(pstree -lpA "$PID" | tail -n 1)" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g') -cd "$(readlink /proc/"$PID"/cwd)" +PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')" +cd "$(readlink /proc/"$PID"/cwd)" || return 1 "$TERMINAL"