Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
#
# -- virtualdj-historian.sh --
# A helper script for proper OBS track IDs from Virtual DJ tracklist.txt
#
# USAGE:
#
# 1. Download to your home directory
# 2. chmod +x virtualdj-historian.sh
# 3. ./virtualdj-historian.sh
#
# EXAMPLE:
#
# ❯ ./virtualdj-historian.sh
# Tony Moran - I Give In (feat. Orion) [Bryan Reyes and Deep Influence Mix]
#
# AUTHOR:
# Josh Delsman (twitch.tv/djjoshuad)
#
# Get local path of Virtual DJ tracklist:
tracklist="${HOME}/Documents/VirtualDJ/History/tracklist.txt"
nowplaying="${HOME}/Documents/VirtualDJ/History/now-playing.txt"
# Watch the end of the tracklist, and for each new matching track (beginning with "NN:NN : "),
# strip the aforementioned prefix data, and put the rest of the data into
# 'now-playing.txt' in the same folder.
exec /usr/bin/tail -n1 -f "${tracklist}" | sed -l -e 's/^\([0-9]*:[0-9]* : \)//g' | tee "${nowplaying}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment