Last active
November 21, 2023 06:30
-
-
Save dsprenkels/0f73fb28a2baf0838585 to your computer and use it in GitHub Desktop.
MDP alarm
This file contains 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/bash | |
# Copyright 2015 Daan Sprenkels <[email protected]> | |
export MPD_HOST="$MPD_PASSWD@localhost" | |
export MPD_PORT=6600 | |
PLAYLISTS_DIR="/var/lib/mpd/playlists" | |
# Don't activate if we are already playing music | |
[[ $(mpc status | grep '^\[playing\]') ]] && exit 0 | |
mpc clear | |
cat "$(ls -1 ${PLAYLISTS_DIR}/*.m3u | sort -R | head -n1)" | mpc add | |
mpc play | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great. All the other ones I've found were to complicated for what they are.