1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-12-22 16:48:13 +00:00

Added script to exec commands in a new tmux window

This commit is contained in:
J.Fernando Sánchez 2013-04-04 18:13:46 +02:00
parent 3e52be8bec
commit c7a322d98d
3 changed files with 28 additions and 26 deletions

View File

@ -4,7 +4,6 @@ then
pgrep -l -u "$USER" -f "$1" | egrep -v "/bin/bash|/bin/sh" | grep -vq "$$"
if [ $? == "0" ]
then
ps aux | grep terminator > /home/balkian/LOG
WID=`xdotool search --class $1 | head -1`
wmctrl -i -a $WID
if [ "x$2" != "x" ]

28
one-tmux Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
if [ "x$1" != "x" ]
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 &
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" ]
then
shift
if [ $tab == 1 ]
then
eval "tmux neww"
sleep 0.2
fi
xdotool type "$*"
xdotool key Return
fi
else
echo "Usage: $0 <terminal-emulator> [extra action]"
fi

View File

@ -1,25 +0,0 @@
#!/bin/bash
if [ "x$1" != "x" ]
then
WID=`xdotool search --class $1 | head -1`
if [ "s$WID" != "s" ]
then
ps aux | grep terminator > /home/balkian/LOG
wmctrl -i -a $WID
if [ "x$2" != "x" ]
then
eval "$2"
fi
else
if [ "x$3" == "x" ]
then
/usr/bin/$1
else
eval "$3"
fi
fi
else
echo "Usage: one-instance program-name [extra action]"
fi