1
0
mirror of https://github.com/balkian/dotfiles.git synced 2025-08-23 16:02:19 +00:00

One-instance and bashrc scripts. Plus a modified script to download songs from goear

This commit is contained in:
J.Fernando Sánchez
2011-07-10 04:39:44 +02:00
parent 77599a08ad
commit cdd5045184
9 changed files with 303 additions and 0 deletions

25
one-instance Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
if [ "x$1" != "x" ]
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" ]
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