Skip to content

Auto‐launching pikaraoke

Vicwomg edited this page Sep 5, 2024 · 16 revisions

Linux / Raspberry Pi

Add an autostart file for pikaraoke

Start by adding a new autostart launcher.

## Create an autostart launcher
mkdir ~/.config/autostart
touch ~/.config/autostart/pikaraoke.desktop

Edit the autolaunch file

Instructions if pikaraoke is installed globally

If you installed pikaraoke globally with pip (ex pip install pikaraoke --break-system-packages), edit your ~/.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.

Instructions if Pikaraoke is installed in a virtual environment

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 ~/launch-pikaraoke-venv.sh
chmod +x ~/launch-pikaraoke-venv.sh
nano ~/launch-pikaraoke-venv.sh

Add this to the ~/launch-pikaraoke-venv.sh file (assuming your virtual env is located at: ~/.venv). Note that this all assumes /home/pi is the absolute path of your home directory. Change this out as necessary (echo $HOME should tell your the absolute path).

#!/bin/sh
source /home/pi/.venv/bin/activate
pikaraoke

Next, edit your ~/.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.

Other notes

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.

OSX

// todo

Windows

// todo