#!/bin/bash

path=`dirname $0`
source $path/meteo.cfg

############# Fermer les Conky Meteo ouverts ######################### 

for p in `ps aux | grep [c]onkyrc_meteo_lune_gen |awk '{ print $2}'`; do kill -9 $p;done;
for q in `ps aux | grep [c]onkyrc_meteo_lune_cc |awk '{ print $2}'`; do kill -9 $q;done;
for r in `ps aux | grep [c]onkyrc_meteo_lune_5j |awk '{ print $2}'`; do kill -9 $r;done;
for s in `ps aux | grep [c]onkyrc_meteo_lune_lu |awk '{ print $2}'`; do kill -9 $s;done;
for i in `ps aux | grep [m]eteocinqj |awk '{ print $2}'`; do kill -9 $i;done;
for i in `ps aux | grep [m]eteocourante |awk '{ print $2}'`; do kill -9 $i;done;
for i in `ps aux | grep [m]eteogenerale |awk '{ print $2}'`; do kill -9 $i;done;


cp ${DirShell}/icones/back$1/* ${DirShell}/icones/base

############ Réaffichage panneaux après mise à jour ##################

if [[ -n $p ]]
	then
  meteogen.sh &
	#conky -c ~/.conkyrc_meteo_lune_gen &
	if [[ -n $attente ]]
		then
		~/conky/meteo+lune4/attente_cc.sh $attente
	fi
fi

if [[ -n $q ]]
	then
  meteocc.sh &
	#conky -c ~/.conkyrc_meteo_lune_cc &
	if [[ -n $attente ]]
		then
		~/conky/meteo+lune4/attente_cc.sh $attente
	fi
fi

if [[ -n $r ]]
	then
  meteo5j.sh &
	#conky -c ~/.conkyrc_meteo_lune_5j &
	if [[ -n $attente ]]
		then
		~/conky/meteo+lune4/attente_5j.sh $attente
	fi
fi

if [[ -n $s ]]
	then
  meteolu.sh
	#conky -c ~/.conkyrc_meteo_lune_lu &
	if [[ -n $attente ]]
		then
		~/conky/meteo+lune4/attente_lu.sh $attente
	fi
fi

exit 0