Skip to content

Commit

Permalink
Executes mpd binary on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
yemi committed May 22, 2016
1 parent f76e0bc commit 533d15a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import Network.Wreq (asJSON, defaults, getWith, header,
param, responseBody)
import System.Console.Haskeline (InputT (), defaultSettings,
getInputChar,
getInputLineWithInitial, outputStrLn,
outputStr, runInputT)
getInputLineWithInitial, outputStr,
outputStrLn, runInputT)
import System.Process (createProcess, proc)

import Toon

type UI a = InputT IO a

Expand Down Expand Up @@ -120,6 +123,12 @@ renderUI _ = do

main :: IO ()
main = runInputT defaultSettings $ do

-- Start `mpd` server
_ <- liftIO . createProcess $ proc "mpd" ["--no-config"]


-- Usage info
outputStrLn "\ntt "
outputStrLn "tt oooo oooo nn nnn "
outputStrLn "tttt oo oo oo oo nnn nn "
Expand All @@ -134,5 +143,6 @@ main = runInputT defaultSettings $ do
outputStrLn "Tooning:\n"
outputStrLn "r - enter URL to track\n"

-- Render UI
renderUI Stopped

1 change: 1 addition & 0 deletions toon.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ executable toon
, lens
, text
, libmpd
, process
default-language: Haskell2010

test-suite toon-test
Expand Down

0 comments on commit 533d15a

Please sign in to comment.