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

New config

This commit is contained in:
J. Fernando Sánchez
2015-09-18 02:14:17 +02:00
parent 8e833119db
commit fc8c11d360
117 changed files with 1533 additions and 1083 deletions

27
scripts/.bin/one-instance Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
if [ "x$1" != "x" ]
then
pgrep -l -u "$USER" -f "$1" | egrep -v "/bin/bash|/bin/sh" | grep -vq "$$"
if [ $? == "0" ]
then
WID=`xdotool search --class $1 | head -1`
CWID=`xdotool getactivewindow`
if [ "x$WID" != "x$CWID" ];
then
xdotool windowactivate $WID
#wmctrl -i -R $WID
else
xdotool windowminimize $WID
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