1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-24 21:22:29 +00:00

Use a default terminal emulator

This commit is contained in:
J.Fernando Sánchez 2013-04-04 19:00:57 +02:00
parent c7a322d98d
commit 4c6e834e03

View File

@ -1,20 +1,21 @@
#!/bin/bash #!/bin/bash
if [ "x$1" != "x" ] TERMINAL_EMULATOR='xfce4-terminal'
tab=1
pgrep -l -u "$USER" -f "$TERMINAL_EMULATOR" | egrep -v "/bin/zsh|/bin/bash|/bin/sh" | grep -vq "$$"
if [ $? != "0" ]
then then
tab=1 /usr/bin/$TERMINAL_EMULATOR &
pgrep -l -u "$USER" -f "$1" | egrep -v "/bin/zsh|/bin/bash|/bin/sh" | grep -vq "$$"
if [ $? != "0" ]
then
/usr/bin/$1 &
sleep 1 sleep 1
tab=0 tab=0
fi fi
echo "Bring it on" >> /tmp/prueba.log WID=`xdotool search --class $TERMINAL_EMULATOR | tail -1`
WID=`xdotool search --class $1 | tail -1` wmctrl -i -a $WID
wmctrl -i -a $WID if [ "x$1" != "x" ]
if [ "x$2" != "x" ] then
if [ "x$1" == "xhelp" ]
then then
shift echo "Usage: $0 [command-in-new-window]"
else
if [ $tab == 1 ] if [ $tab == 1 ]
then then
eval "tmux neww" eval "tmux neww"
@ -23,6 +24,4 @@ then
xdotool type "$*" xdotool type "$*"
xdotool key Return xdotool key Return
fi fi
else
echo "Usage: $0 <terminal-emulator> [extra action]"
fi fi