petits-scripts-persos/term
2025-06-06 00:14:54 +02:00

5 lines
175 B
Bash
Executable File

#!/bin/sh
pid="$(xdotool getactivewindow getwindowpid)"
[ -n "$pid" ] && cd "$(readlink -f "/proc/$(pgrep -P "$pid")/cwd")" &>/dev/null || cd "$HOME"
exec st "${SHELL:-bash}"