From b488df4f931c990ee2f754ed359605e5763a833f Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Thu, 3 Sep 2015 13:30:00 +0200 Subject: Fixed duplicating panels --- herbstluftwm/.config/herbstluftwm/start_panel.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'herbstluftwm') diff --git a/herbstluftwm/.config/herbstluftwm/start_panel.sh b/herbstluftwm/.config/herbstluftwm/start_panel.sh index e573a53..42e33fd 100755 --- a/herbstluftwm/.config/herbstluftwm/start_panel.sh +++ b/herbstluftwm/.config/herbstluftwm/start_panel.sh @@ -11,12 +11,12 @@ if [ -z "$geometry" ] ;then fi # Make sure only one instanve per monitor is running -lockfile="/tmp/start_panel-$monitor.lck" -if [ -e "$lockfile" ] && kill -0 $(cat $lockfile); then - pkill -P $(cat $lockfile) -fi -trap "rm -f $lockfile; exit" INT TERM EXIT -echo "$$" > "$lockfile" +pids=$(ps x | grep "$0 $monitor" | awk '{print $1}') +for pid in $pids; do + if [ $pid != $$ ]; then + pkill -P $pid + fi +done # Geometry has the format W H X Y x=$(echo "${geometry[0]} + $window_p" | bc) -- cgit v1.2.3