#!/bin/bash
PROCESS="compton"
PROCANDARGS="compton -f -F -c -e 0.9 -i 1"
while :
do
    RESULT=`pgrep ${PROCESS}`

    if [ -n ${RESULT} ]; then
            echo "${PROCESS} not running, starting "$PROCANDARGS
            $PROCANDARGS &
              if grep -xq "^ft10-compton" ~/.desktop-session/startup; then
				 status="already found ft10-compton on startup file, doing nothing"
				else
				 #ft10-compton not found on startup file, adding it
				 echo ft10-compton >> ~/.desktop-session/startup
			  fi
            exit
     
      else
            echo "${PROCESS} running, killing it"
            sed -i '/ft10-compton/d' ~/.desktop-session/startup
            pkill compton
    fi
    done    
exit
