mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Simpler sed command
This commit is contained in:
parent
c8aa0495eb
commit
ce1d461d65
@ -3,7 +3,7 @@
|
|||||||
# Open a terminal window in the same directory as the currently active window.
|
# Open a terminal window in the same directory as the currently active window.
|
||||||
|
|
||||||
PID=$(xprop -id "$(xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
|
PID=$(xprop -id "$(xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
|
||||||
PID=$(pstree -lpATna "$PID" | grep -v '\-\(lf,[0-9]\+ -server\|(st-urlhandler,[0-9]\+)\|xclip,[0-9]\+\)' | sed '$s/.*,\([0-9]\+\).*/\1/;t;d')
|
PID=$(pstree -lpATna "$PID" | grep -v '\-\(lf,[0-9]\+ -server\|(st-urlhandler,[0-9]\+)\|xclip,[0-9]\+\)' | sed -n '$s/.*,\([0-9]\+\).*/\1/p')
|
||||||
cwd=$(readlink /proc/"$PID"/cwd)
|
cwd=$(readlink /proc/"$PID"/cwd)
|
||||||
[ "$PWD" != "$cwd" ] && [ -d "$cwd" ] && { cd "$cwd" || exit 1; }
|
[ "$PWD" != "$cwd" ] && [ -d "$cwd" ] && { cd "$cwd" || exit 1; }
|
||||||
"$TERMINAL"
|
"$TERMINAL"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user