mirror of
https://github.com/balkian/dotfiles.git
synced 2024-11-21 19:52:29 +00:00
Use a default terminal emulator
This commit is contained in:
parent
c7a322d98d
commit
4c6e834e03
27
one-tmux
27
one-tmux
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user