Last active
March 15, 2021 03:40
-
-
Save voxxit/b5104fa8c31a2d23e97b077d79ba7590 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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