mirror of https://github.com/balkian/dotfiles.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
584 B
Plaintext
28 lines
584 B
Plaintext
11 years ago
|
#!/bin/bash
|
||
11 years ago
|
TERMINAL_EMULATOR='urxvt'
|
||
11 years ago
|
tab=1
|
||
|
pgrep -l -u "$USER" -f "$TERMINAL_EMULATOR" | egrep -v "/bin/zsh|/bin/bash|/bin/sh" | grep -vq "$$"
|
||
|
if [ $? != "0" ]
|
||
11 years ago
|
then
|
||
11 years ago
|
/usr/bin/$TERMINAL_EMULATOR &
|
||
11 years ago
|
sleep 1
|
||
|
tab=0
|
||
11 years ago
|
fi
|
||
|
WID=`xdotool search --class $TERMINAL_EMULATOR | tail -1`
|
||
|
wmctrl -i -a $WID
|
||
|
if [ "x$1" != "x" ]
|
||
|
then
|
||
|
if [ "x$1" == "xhelp" ]
|
||
11 years ago
|
then
|
||
11 years ago
|
echo "Usage: $0 [command-in-new-window]"
|
||
|
else
|
||
11 years ago
|
if [ $tab == 1 ]
|
||
|
then
|
||
|
eval "tmux neww"
|
||
|
sleep 0.2
|
||
|
fi
|
||
|
xdotool type "$*"
|
||
|
xdotool key Return
|
||
|
fi
|
||
|
fi
|