title: How to start a service only when a user log to Desktop Environment
body: <p>I trying to find a solution on starting a service or to execute a binary only when a user logs to his desktop environment. Basically, my binary is dependent on the Display environment of the user.</p>
  
  <p>I tried with systemctl and PAM methods but unable to find a way. I tried with a script using cron, which would check the Display environment and start the binary. But i would like to use the service method rather than the cron method.</p>