Skip to content

Instantly share code, notes, and snippets.

@gatlin
Created April 15, 2014 10:21
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 gatlin/10720633 to your computer and use it in GitHub Desktop.
Save gatlin/10720633 to your computer and use it in GitHub Desktop.
Load this into ghci, load a song into your MPD playlist, and then run startTimer with the correct number of seconds.
{-# LANGUAGE OverloadedStrings #-}
import Network.MPD
import Control.Concurrent.Timer
import Control.Concurrent.Suspend.Lifted
import System.Environment
startTimer seconds = oneShotTimer (withMPD (play Nothing) >> return ()) (sDelay (fromInteger seconds))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment