summaryrefslogtreecommitdiffstats
path: root/.local/bin/samedir
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-02-08 18:43:37 -0500
committerLuke Smith <luke@lukesmith.xyz>2020-02-08 18:43:37 -0500
commit2b5df860ded1412a0c0be0d140d138616e926dfc (patch)
tree7cf2598594bfd640b61771704012c87cae154034 /.local/bin/samedir
parenta25e8b640ac83b6eb345977e59803e999bc42202 (diff)
downloadeibhear-2b5df860ded1412a0c0be0d140d138616e926dfc.tar.gz
eibhear-2b5df860ded1412a0c0be0d140d138616e926dfc.tar.zst
eibhear-2b5df860ded1412a0c0be0d140d138616e926dfc.zip
#!/bin/sh shebang. newline after universalized.
Diffstat (limited to '.local/bin/samedir')
-rwxr-xr-x.local/bin/samedir3
1 files changed, 2 insertions, 1 deletions
diff --git a/.local/bin/samedir b/.local/bin/samedir
index f2ac87f..740dcfc 100755
--- a/.local/bin/samedir
+++ b/.local/bin/samedir
@@ -1,4 +1,5 @@
-#!/usr/bin/env sh
+#!/bin/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)"