Getting somewhere
This commit is contained in:
parent
2b15e28a68
commit
0bcd10b35a
17
exe/Main.hs
17
exe/Main.hs
@ -1,19 +1,24 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import System.Posix.Directory ( getWorkingDirectory )
|
||||
import System.Directory.Extra ( listContents )
|
||||
import System.Directory.Extra ( listFiles )
|
||||
import Control.Monad ( (<=<), filterM )
|
||||
import System.Process ( ProcessHandle, spawnCommand )
|
||||
import Turtle ( Alternative(empty), shell, ExitCode )
|
||||
import Turtle.Format
|
||||
import Data.Text ( Text, pack )
|
||||
|
||||
fetchLocalAudio :: FilePath -> IO [FilePath]
|
||||
fetchLocalAudio = filterM isAudioVideo <=< listContents
|
||||
fetchLocalAudio = filterM isAudioVideo <=< listFiles
|
||||
|
||||
isAudioVideo :: FilePath -> IO Bool
|
||||
isAudioVideo = undefined
|
||||
|
||||
-- Paths need to be escaped if containing certain characters
|
||||
playHeadless :: FilePath -> IO ProcessHandle
|
||||
playHeadless = spawnCommand . (++) "mpv --vid=no "
|
||||
-- TODO: Make run in background and without stdout
|
||||
-- TODO: Find alternative due to comment on https://hackage.haskell.org/package/turtle-1.6.2/docs/Turtle-Prelude.html#g:6
|
||||
playHeadless :: FilePath -> IO ExitCode
|
||||
playHeadless = flip shell empty . format ("mpv --vid=auto \""%s%"\"") . pack
|
||||
|
||||
main :: IO ()
|
||||
main =
|
||||
|
@ -52,6 +52,7 @@
|
||||
packages = p: [ self.packages.${system}.snaus ];
|
||||
withHoogle = true;
|
||||
buildInputs =
|
||||
(with pkgs; [ zlib ]) ++
|
||||
(with haskellPackages; [
|
||||
haskell-language-server
|
||||
cabal-install
|
||||
|
@ -75,10 +75,14 @@ executable snaus
|
||||
, directory
|
||||
, vty
|
||||
, hashmap-io
|
||||
, process
|
||||
, turtle
|
||||
, filepath
|
||||
, text
|
||||
|
||||
-- Directories containing source files.
|
||||
hs-source-dirs: exe
|
||||
|
||||
default-extensions: OverloadedStrings
|
||||
|
||||
-- Base language which the package is written in.
|
||||
default-language: GHC2021
|
||||
|
Loading…
Reference in New Issue
Block a user