#!/bin/sh # Opens a terminal from another terminal's working directory # we look for the cwd of it's child process cd $(pwdx $(pstree -p $(xdotool getwindowpid $(xdotool getwindowfocus)) \ | head -1 \ | cut -f3 -d'(' \ | cut -f1 -d')') \ | awk '{print $2}') setsid ${TERMINAL:-st}