mirror of https://github.com/tiyn/dotfiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
423 B
10 lines
423 B
#!/bin/sh
|
|
|
|
# Open a terminal window in the same directory as the currently active window.
|
|
# Obtained from https://github.com/lukesmithxyz/voidrice
|
|
|
|
PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3)
|
|
PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')"
|
|
cd "$(readlink /proc/"$PID"/cwd)" || return 1
|
|
setsid "$TERMINAL"
|