-
Notifications
You must be signed in to change notification settings - Fork 137
Auto‐launching pikaraoke
Start by adding a new autostart launcher. Note that this all assumes /home/pi is your home directory. Change this out as necessary.
## Create an autostart launcher
mkdir /home/pi/.config/autostart
touch /home/pi/.config/autostart/pikaraoke.desktop
If you installed pikaraoke globally with pip (ex pip install pikaraoke --break-system-packages
), edit your /home/pi/.config/autostart/pikaraoke.desktop
file to include this:
[Desktop Entry]
Type=Application
Name=Pikaraoke
Exec=pikaraoke
Note: you can add additional command line parameters to the Exec command if you wish. Ex: Exec=pikaraoke -l10 --headless --normalize-audio
Restart and it should auto-launch on your next boot.
There are some additional steps to activating a virtual env and this cannot be done within a single Exec command. You must create a wrapper script.
# Create a pikaraoke wrapper script
touch /home/pi/launch-pikaraoke-venv.sh
chmod +x /home/pi/launch-pikaraoke-venv.sh
nano /home/pi/launch-pikaraoke-venv.sh
Add this to the /home/pi/launch-pikaraoke-venv.sh
file (assuming your virtual env is located at: ~/.venv
)
#!/bin/sh
source /home/pi/.venv/bin/activate
pikaraoke
Next, edit your /home/pi/.config/autostart/pikaraoke.desktop
file to include this:
[Desktop Entry]
Type=Application
Name=Pikaraoke
Exec=/home/pi/launch-pikaraoke-venv.sh
Restart and it should auto-launch on your next boot.
If you want to kill the pikaraoke process, you can do so from the PiKaraoke Web UI under: Info > Quit pikaraoke
. Or you can ssh in and run sudo killall python
or something similar.
Note that if your wifi/network is inactive pikaraoke will error out 10 seconds after being launched. This is to prevent the app from hijacking your ability to login to repair the connection.
// todo
// todo