Script to swap jukebox libraries

Notes below are about auto-opening Silverjuke and toggling between two Silverjuke libraries (i.e. parent & kids), though I don't use this anymore and just leave it on the kids library and pipe my music through bluetooth when I want to.

I set Hotkeys in antiX to swap media libraries by editing ~/.icewm/keys, adding the lines:

key "Ctrl+Alt+s" /home/vm/silverjuke_toggle.sh

This means I can run silverjuke_toggle.sh by pressing:

<SUPER>-s (i.e. windows key & 's')

The script, silverjuke_toggle.sh, closes Silverjuke and re-opens it with the other library.

nano ~/Desktop/silverjuke_toggle.sh

#!/bin/bash
TOGGLE=$HOME/.toggle

killall silverjuke

if [ ! -e $TOGGLE ]; then
    touch $TOGGLE
    silverjuke --jukebox=/home/vm/.config/silverjuke/yoda.jukebox --kioskrect=1 --kiosk &
else
    rm $TOGGLE
    silverjuke --jukebox=/home/vm/.config/silverjuke/default.jukebox --kioskrect=1 --kiosk &
fi

And add the following to crontab, so Silverjuke opens with the default library each boot:

@reboot rm /home/vm/.toggle

shell script to toggle between two commands


@electroluckydip