1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-12-22 16:48:13 +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
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
tab=1
pgrep -l -u "$USER" -f "$1" | egrep -v "/bin/zsh|/bin/bash|/bin/sh" | grep -vq "$$"
if [ $? != "0" ]
then
/usr/bin/$1 &
/usr/bin/$TERMINAL_EMULATOR &
sleep 1
tab=0
fi
echo "Bring it on" >> /tmp/prueba.log
WID=`xdotool search --class $1 | tail -1`
wmctrl -i -a $WID
if [ "x$2" != "x" ]
fi
WID=`xdotool search --class $TERMINAL_EMULATOR | tail -1`
wmctrl -i -a $WID
if [ "x$1" != "x" ]
then
if [ "x$1" == "xhelp" ]
then
shift
echo "Usage: $0 [command-in-new-window]"
else
if [ $tab == 1 ]
then
eval "tmux neww"
@ -23,6 +24,4 @@ then
xdotool type "$*"
xdotool key Return
fi
else
echo "Usage: $0 <terminal-emulator> [extra action]"
fi