all repos — dotfiles @ 4359a0cb741c7fafd9b0d1c15bf629e3e5e89140

linux dotfiles

bin/scripts/i3scripts/samedir (view raw)

 1
 2
 3
 4
 5
#!/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)"
"$TERMINAL"