#!/bin/bash

USERS=$(who |sed 's/ .*//'|head -n1)
AUTOSTART=$(grep -E "my-weather-indicator-autostart" /home/$USERS/.config/autostart/my-weather-indicator-autostart.desktop)
function launch {
if [ "$AUTOSTART" = "Name=my-weather-indicator-autostart" ]; then
# Fix the autostart notification icon to show in panel with sleep 10
sleep 10
pkill -f /usr/share/my-weather-indicator/my-weather-indicator
sleep 1
/usr/share/my-weather-indicator/my-weather-indicator
elif [ "$AUTOSTART" = "" ]; then
/usr/share/my-weather-indicator/my-weather-indicator
   fi
}
launch
exit 
