2024-06-21 16:28:36 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
WINDOW_ID=$(xdotool getactivewindow)
|
|
|
|
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
|
|
|
|
|
2024-06-21 17:16:54 +01:00
|
|
|
uuid=$(uuidgen)
|
|
|
|
|
2024-06-21 16:28:36 +01:00
|
|
|
if [ -f $HOME/.config/terminalscwd/$WM_NAME.ssh ]; then
|
2024-06-21 17:16:54 +01:00
|
|
|
cp $HOME/.config/terminalscwd/$WM_NAME.ssh $HOME/.config/terminalscwd/$uuid.ssh
|
|
|
|
alacritty --title $uuid -e sh -c "TERMINAL_UUID=$uuid PARENT_TERMINAL=$WM_NAME ssh $(cat $HOME/.config/terminalscwd/$WM_NAME.ssh)"
|
2024-06-21 17:06:29 +01:00
|
|
|
else
|
2024-06-21 17:16:54 +01:00
|
|
|
cp $HOME/.config/terminalscwd/$WM_NAME.pwd $HOME/.config/terminalscwd/$uuid.pwd
|
2024-06-21 17:40:01 +01:00
|
|
|
alacritty --title $uuid -e sh -c "TERMINAL_UUID=$uuid PARENT_TERMINAL=$WM_NAME exec $SHELL"
|
2024-06-21 16:28:36 +01:00
|
|
|
fi
|