Max2play is a great way to have an out of the box music server running on a Raspberry Pi with a touch screen. I’ve installed Max2play on a Raspberry Pi 3 and 7 inch touch screen. The only problem with it is that I would like to run other software on the Pi as well (such as control my Phillips Hue lighting). Out the box, the Pi now boots up and runs the full screen Jivelite app which controls the music. There are two options I could think of: 1. Write a plugin for Jivelite to control the Hue lights, or 2, control the lighting with a separate app and have the ability to launch jivelite manually. I went for 2 since Jivelite is written in Lua which I don’t know.
The first problem is how to launch Jivelite manually. For this I added a Jivelite icon to the desktop. I’m assuming Max2play is installed with Jivelite options and everything is working.
In the Jivelite plugin settings, disable autostart. In the Settings/Reboot tab, enable Autostart desktop (the desktop is normally started with the jivelite plugin so we need to enable it here).
In the Pi’s file manager go to Edit/Preferences – enable ‘Open files with Single click’ – it’s not easy double clicking with the touch screen. You might also want to increase the icon sizes whilst your there. These setting affect the desktop as well.
SSH into the Raspberry pi – either from the terminal or via the web plugin you can install. Go to the desktop folder and create a desktop launch shortcut. We will start by making one to launch jivelite. So create a text file with
nano jivelite.desktop and add
[Desktop Entry] Type=Application Icon=/home/pi/music.png <edit this to point to your own icon> Name=Jivelite Comment=Start the Jivelite music player Exec=/opt/jivelite/jivelite/bin/jivelite
Save the file and that’s it. You should be now be able to launch jivelite from the desktop icon. The quit button does not quit the application (it seems to stop the music), so you have to quit from the menu options on Jivelite. (There appears to be a patch file that creates this behavior but I’ll investigate that at a latter date.)
To autostart at login, make a symbolic link to the .desktop file and place it in ~/.config/autostart
You may want to disable the screensaver which blanks the screen after 10 minutes as is.
Remove the @xscreensaver -no-splash line from /etc/xdg/lxsession/LXDE/autostart and from ~/.config/lxsession/LXDE/autostart Stopping the screensaver server has no effect. I’m not sure what causes the screen to blank when running the GUI. It might be power saving in X. To disable the screensaver, the easiest method is to install a screensaver client and configure that not to run.
sudo apt-get install xscreensaver
After that’s completed there will be a screensaver option in the LXDE GUI menu. Run that and disable the screensaver from there.