IT FUCKING WORKS
This commit is contained in:
parent
62212e6b83
commit
90b5a8ad61
|
@ -3,8 +3,12 @@
|
|||
WINDOW_ID=$(xdotool getactivewindow)
|
||||
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
|
||||
|
||||
uuid=$(uuidgen)
|
||||
|
||||
if [ -f $HOME/.config/terminalscwd/$WM_NAME.ssh ]; then
|
||||
alacritty -e sh -c "PARENT_TERMINAL=$WM_NAME ssh $(cat $HOME/.config/terminalscwd/$WM_NAME.ssh)"
|
||||
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)"
|
||||
else
|
||||
alacritty -e sh -c "PARENT_TERMINAL=$WM_NAME exec $SHELL"
|
||||
cp $HOME/.config/terminalscwd/$WM_NAME.pwd $HOME/.config/terminalscwd/$uuid.pwd
|
||||
alacritty --title uuid -e sh -c "PARENT_TERMINAL=$WM_NAME exec $SHELL"
|
||||
fi
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
if [ "$PRESERVE_SSH_CWD" = "true" ]; then
|
||||
WINDOW_ID=$(xdotool getactivewindow)
|
||||
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
|
||||
export TERMINAL_UUID=$WM_NAME
|
||||
if [ -z $TERMINAL_UUID ]; then
|
||||
if [ -z $DISPLAY ]; then
|
||||
export TERMINAL_UUID=$(uuidgen)
|
||||
else
|
||||
WINDOW_ID=$(xdotool getactivewindow)
|
||||
WM_NAME=$(xprop -id $WINDOW_ID WM_NAME | cut -d '"' -f 2)
|
||||
export TERMINAL_UUID=$WM_NAME
|
||||
fi
|
||||
fi
|
||||
echo -en "\e]2;$TERMINAL_UUID\a"
|
||||
|
||||
mkdir -p $HOME/.config/terminalscwd/
|
||||
cd() {
|
||||
builtin cd $1
|
||||
|
|
Loading…
Reference in New Issue