chundermike / rpi-fruitbox-v2

Retro MP3 Jukebox for Raspberry Pi
76 stars 12 forks source link

Auto load Fruitbox on boot - rc.local deprecated (workaround) #60

Open Harry-Badger opened 3 months ago

Harry-Badger commented 3 months ago

Model: Raspberry Pi 4B 4GB OS: Raspberry PI OS 32-bit Full (Linux 11 Bullseye) Version: Fruitbox v2 Skin: skins/JaysIndieglo

I am trying to get Fruitbox to auto start on boot. The user guide suggests editing and adding a couple of lines to the rc.local file.

sudo nano /etc/rc.local

However, the drawbacks of this are that rc.local is deprecated and is executed before the desktop starts.

I have personally not got this to work, but I had more success with autostart. E.g.

sudo nano /home/.config/autostart/Fruitbox.desktop

[Desktop Entry]
Type=Application
Name=Fruitbox
Exec=/home/pi/fruitbox/fruitbox

The niggle I found with this method was Fruitbox would start whilst the desktop was still loading. It would end up in a windowed view rather than max full screen (1920x1080). This truncated the Fruitbox UI at the bottom because of the desktop taskbar and the Fruitbox window title bar. Shutting down Fruitbox and restarting, would see it run properly in full screen mode with no borders or taskbar

My workaround is:

!#/bin/bash
cd /home/pi/fruitbox
sleep 5
./fruitbox

The sleep 5 will give the PI Desktop GUI enough time to load before running Fruitbox

sudo chmod +x fruitbox.sh

sudo nano /home/.config/autostart/fruitbox.desktop

[Desktop Entry]
Type=Application
Name=Fruitbox
Exec=sh /home/pi/fruitbox.sh

With this in place, I now have Fruitbox auto loading seamless on boot

Hope this helps anyone with getting Fruitbox to auto start on boot