mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 04:20:23 +00:00
Cleanup the code a bit
This commit is contained in:
@@ -5,9 +5,10 @@ terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}')
|
||||
shell_pid=$(pgrep -P "$terminal_pid" | head -n1)
|
||||
|
||||
if [[ -n $shell_pid ]]; then
|
||||
found_cwd=$(readlink -f "/proc/$shell_pid/cwd" 2>/dev/null || echo "$HOME")
|
||||
if [[ -d "$found_cwd" ]]; then
|
||||
echo "$found_cwd"
|
||||
cwd=$(readlink -f "/proc/$shell_pid/cwd" 2>/dev/null)
|
||||
|
||||
if [[ -d $cwd ]]; then
|
||||
echo "$cwd"
|
||||
else
|
||||
echo "$HOME"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user