mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Start new terminals with a working directory based on current active terminal
Co-authored-by: @halilozercan Closes #835
This commit is contained in:
6
bin/omarchy-cmd-terminal-cwd
Executable file
6
bin/omarchy-cmd-terminal-cwd
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Go from current active terminal to its child shell process and run cwd there
|
||||
terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}')
|
||||
shell_pid=$(pgrep -P "$terminal_pid" | head -n1)
|
||||
readlink -f "/proc/$shell_pid/cwd" 2>/dev/null || echo "$HOME"
|
||||
Reference in New Issue
Block a user