dotfiles/bin/clone-terminal

12 lines
293 B
Plaintext
Raw Permalink Normal View History

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