add scripts, mostly taken from LARBS

This commit is contained in:
Tibeuleu
2024-03-06 11:35:50 +01:00
parent daa93aadf5
commit 8160de0f74
43 changed files with 939 additions and 22 deletions

8
.local/bin/samedir Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
# Open a terminal window in the same directory as the currently active window.
PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3)
PID="$(pstree -lpA "$PID" | tail -n 1 | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')"
cd "$(readlink /proc/"$PID"/cwd)" || return 1
"$TERMINAL"