I wanted to send a popup on boot with zenify:
zenity --info --text="`hostname -I`" --title="Rpi Local IP" --display=:0.0 So here is my service file:
[Unit] Description=Display IP at boot After=networking.service graphical.target Wants=networking.service graphical.target [Service] User=pi Environment=DISPLAY=:0.0 Environment=XAUTHORITY=/home/pi/.Xauthority ExecStart=/bin/bash -c 'zenity --info --text="`hostname -I`" --title="Rpi Local IP" --display=:0.0' [Install] WantedBy=graphical.target An error occured everytime:
raspberrypi bash[530]: Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused raspberrypi zenity[530]: cannot open display: :0.0 If I add like 10 seconds of sleep before starts my service : ExecStartPre=/bin/sleep 10, everything works well.
Where is my mistake ?
Thank you :) !