dotfiles/bin/clone-terminal

11 lines
344 B
Plaintext
Raw Normal View History

2024-06-21 17:28:36 +02:00
#!/usr/bin/env bash
WINDOW_ID=$(xdotool getactivewindow)
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
if [ -f $HOME/.config/terminalscwd/$WM_NAME.ssh ]; then
2024-06-21 17:32:39 +02:00
alacritty -e sh -c "PARENT_TERMINAL=$WM_NAME ssh $(cat $HOME/.config/terminalscwd/$WM_NAME.ssh)"
2024-06-21 18:06:29 +02:00
else
alacritty -e sh -c "PARENT_TERMINAL=$WM_NAME exec $SHELL"
2024-06-21 17:28:36 +02:00
fi