[Unit]
Description=Audio Python Script
After=default.target
Wants=default.target

[Service]
Type=simple
User=squareclouds
Environment=DISPLAY=:0
Environment=HOME=/home/squareclouds
Environment=XDG_RUNTIME_DIR=/run/user/1000
Environment=PYTHONUNBUFFERED=1
Environment=SDL_AUDIODRIVER=alsa

Nice=-5
LimitRTPRIO=99

ExecStartPre=/home/squareclouds/wait-for-x.sh
ExecStart=/usr/bin/chrt -r 20 /usr/bin/python3 /home/squareclouds/audioplayer/main.py
WorkingDirectory=/home/squareclouds/audioplayer

Restart=always
RestartSec=15

StandardOutput=journal
StandardError=journal

[Install]
WantedBy=default.target
