Features missing when run from systemd service
Discussed in https://github.com/TomSchimansky/CustomTkinter/discussions/1015
Originally posted by Gionnij January 8, 2023 Hi everyone, I have a problem: I made a GUI for a raspberry that uses a touch screen, and it works perfectly when run from the terminal.
Because I needed this program to start every time the raspberry boots up, I created a systemd service in the following way:
[Unit] Description=Start wrapper.py
[Service] Environment=DISPLAY=:0.0 Environment=XAUTHORITY=/home/pi/.Xauthority ExecStart=/bin/bash -c '/usr/bin/python3 /home/pi/Water/wrapper.py > /home/pi/Water/wrapper.log 2>&1'
[Install] WantedBy=graphical.target
doing so the program boots up at startup but only once the display is recognized by the system. What's freaking me out is the graphical aspect of the interface, because the rounded corners (the most recognizable feature of the customtkinter interface) are simply gone (see picture below).
Weird condition:

Normal condition:

What's the problem here?
Thanks!!
The problem is that the font file could not be loaded, like here: https://github.com/TomSchimansky/CustomTkinter/issues/300 I don't know why this is not working, but you would have to try to start the script later in the boot process and not with the system service.