summaryrefslogtreecommitdiff
path: root/bin/guiscripts/stdir
diff options
context:
space:
mode:
Diffstat (limited to 'bin/guiscripts/stdir')
-rwxr-xr-xbin/guiscripts/stdir9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/guiscripts/stdir b/bin/guiscripts/stdir
new file mode 100755
index 0000000..7a32981
--- /dev/null
+++ b/bin/guiscripts/stdir
@@ -0,0 +1,9 @@
+#!/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}