Skip to content

Instantly share code, notes, and snippets.

@voxxit
Last active March 15, 2021 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voxxit/b5104fa8c31a2d23e97b077d79ba7590 to your computer and use it in GitHub Desktop.
Save voxxit/b5104fa8c31a2d23e97b077d79ba7590 to your computer and use it in GitHub Desktop.
#!/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