#Set Display via "init" process for current user.
currentuser=$(last -w | grep "logged in" | awk 'NR==1{print $1}') #Current user
initPID=$(ps -u "$currentuser" | awk '$NF=="init" {print $1}') #Get PID of "init" process for current user.
userDP=$(cat /proc/$initPID/environ | tr '\0' '\n' | grep '^DISPLAY=') #Get Display for init process (belonging to current user)
export "$userDP" #Set Display

cd "/opt/ADXBA/Unity/Unity_Agent"
mono Unity_Agent.exe