summaryrefslogtreecommitdiffstats
path: root/.local/bin/samedir
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-08-18 12:28:11 -0400
committerLuke Smith <luke@lukesmith.xyz>2019-08-18 12:28:11 -0400
commit1bca65bfc233273d6032b36dd377589780b69b46 (patch)
tree0768b08f1e8fb59ccd2e6a2cd0a2bd42d7906a56 /.local/bin/samedir
parent6e67bd424d5a091d39b1da040edc93f18c2b4b73 (diff)
downloadeibhear-1bca65bfc233273d6032b36dd377589780b69b46.tar.gz
eibhear-1bca65bfc233273d6032b36dd377589780b69b46.tar.zst
eibhear-1bca65bfc233273d6032b36dd377589780b69b46.zip
portable shebang
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)"