- Relocate themes to assets/themes/ and update all references. - Implement custom SDDM theme and Plymouth theme enhancements. - Add themed templates for Alacritty, Hyprland, Waybar, and other apps. - Introduce Makima key remapper module and configuration. - Add Voxtype and Walker configurations. - Implement systemd power management and timeout optimizations. - Add Nautilus-python extensions for LocalSend. - Update branding assets and ASCII art integration.
23 lines
674 B
Bash
Executable File
23 lines
674 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Returns the current working directory of the active terminal window,
|
|
# so a new terminal window can be started in the same directory.
|
|
|
|
# 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" | tail -n1)
|
|
|
|
if [[ -n $shell_pid ]]; then
|
|
cwd=$(readlink -f "/proc/$shell_pid/cwd" 2>/dev/null)
|
|
shell=$(readlink -f "/proc/$shell_pid/exe" 2>/dev/null)
|
|
|
|
# Check if $shell is a valid shell and $cwd is a directory.
|
|
if grep -qs "$shell" /etc/shells && [[ -d $cwd ]]; then
|
|
echo "$cwd"
|
|
else
|
|
echo "$HOME"
|
|
fi
|
|
else
|
|
echo "$HOME"
|
|
fi
|