dotfiles/bin/clone-terminal

12 lines
293 B
Plaintext
Raw Permalink Normal View History

2024-06-21 17:28:36 +02:00
#!/usr/bin/env bash
2024-06-23 16:31:17 +02:00
# Extract parent window uuid
2024-06-21 17:28:36 +02:00
WINDOW_ID=$(xdotool getactivewindow)
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
2024-06-23 16:31:17 +02:00
# Generate new uuid for new terminal
2024-06-21 18:16:54 +02:00
uuid=$(uuidgen)
2024-06-23 16:31:17 +02:00
alacritty --title $uuid -e sh -c "TERMINAL_UUID=$uuid PARENT_TERMINAL=$WM_NAME exec $SHELL"