summaryrefslogtreecommitdiffstats
path: root/.local/bin/samedir
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/samedir')
-rwxr-xr-x.local/bin/samedir2
1 files changed, 1 insertions, 1 deletions
diff --git a/.local/bin/samedir b/.local/bin/samedir
index 88845fc..f2ac87f 100755
--- a/.local/bin/samedir
+++ b/.local/bin/samedir
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env sh
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)"