1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-09 19:11:15 +02:00

local: changed and updated scripts

This commit is contained in:
2024-03-17 22:52:40 +01:00
parent 62c161c3c1
commit 923fba39f4
20 changed files with 70 additions and 53 deletions

View File

@@ -0,0 +1,9 @@
#!/bin/sh
# Open a terminal window in the same directory as the currently active window.
# Obtained from https://github.com/lukesmithxyz/voidrice
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
setsid "$TERMINAL"