From ef9e436252c857a364b99ba193112b08b7fb4004 Mon Sep 17 00:00:00 2001 From: noctuid Date: Sat, 23 Jan 2016 19:17:50 -0500 Subject: [PATCH] Add initial support for terminix --- README.md | 1 + tdrop | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f5b1ed..599cf22 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ mime ^video, has mpv, X, flag f = tdrop -a auto_hide && mpv -- "$@" && tdrop -a - Terminology - Sakura - Roxterm +- Terminix If your terminal doesn't work with tdrop, feel free to make an issue. diff --git a/tdrop b/tdrop index 84d3991..32dedce 100755 --- a/tdrop +++ b/tdrop @@ -444,10 +444,15 @@ term_create() { else term_command=$term fi + if [[ $term == terminix ]]; then + sleep_term_time=0.3 + fi if [[ -n $session_name ]]; then - # ugly workarounds due to how different terms different -e flags work + # ugly workarounds due to how different terms' different -e flags work if [[ $term == urxvt ]]; then $term_command -e bash -c "sleep $sleep_term_time && xdotool getactivewindow > /tmp/tdrop/$term$num && xdotool getactivewindow windowmove $xoff $yoff windowsize $width $height && tmux attach-session -dt $session_name || tmuxinator start $session_name || tmux new-session -s $session_name" & + elif [[ $term == terminix ]]; then + $term_command -x "bash -c 'sleep $sleep_term_time && xdotool getactivewindow > /tmp/tdrop/$term$num && xdotool getactivewindow windowmove $xoff $yoff windowsize $width $height && tmux attach-session -dt $session_name || tmuxinator start $session_name || tmux new-session -s $session_name'" & else # starting with '/bin/bash -c' because required by termite $term_command -e "/bin/bash -c 'sleep $sleep_term_time && xdotool getactivewindow > /tmp/tdrop/$term$num && xdotool getactivewindow windowmove $xoff $yoff windowsize $width $height && tmux attach-session -dt $session_name || tmuxinator start $session_name || tmux new-session -s $session_name'" & @@ -456,6 +461,8 @@ term_create() { # not using hold, because flag is different for different terminals if [[ $term == urxvt ]]; then $term_command -e bash -c "sleep $sleep_term_time && xdotool getactivewindow > /tmp/tdrop/$term$num && xdotool getactivewindow windowmove $xoff $yoff windowsize $width $height && $SHELL" & + elif [[ $term == terminix ]]; then + $term_command -x "bash -c 'sleep $sleep_term_time && xdotool getactivewindow > /tmp/tdrop/$term$num && xdotool getactivewindow windowmove $xoff $yoff windowsize $width $height && $SHELL'" & else # not using hold, because flag is different for different terminals $term_command -e "/bin/bash -c 'sleep $sleep_term_time && xdotool getactivewindow > /tmp/tdrop/$term$num && xdotool getactivewindow windowmove $xoff $yoff windowsize $width $height && $SHELL'" &