xmonad-extras-0.15.1: Third party extensions for xmonad with wacky dependencies

Copyright | Daniel Schoepe <daniel.schoepe@googlemail.com>
License | BSD3-style (see LICENSE)
Maintainer | Daniel Schoepe <daniel.schoepe@googlemail.com>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Prompt.MPD

Contents

- Usage

Description

This module lets the user select songs and have MPD add/play them by filtering them by user-supplied criteria(E.g. ask for an artist, then for the album..)

Synopsis

- findMatching :: RunMPD -> XPConfig -> [Metadata] -> X [Song]
- findMatchingWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X [Song]
- addMatching :: RunMPD -> XPConfig -> [Metadata] -> X [Int]
- addMatchingWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X [Int]
- addAndPlay :: RunMPD -> XPConfig -> [Metadata] -> X ()
- addAndPlayWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X ()
- loadPlaylist :: RunMPD -> XPConfig -> X ()
- loadPlaylistWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> X ()
- addAndPlayAny :: RunMPD -> XPConfig -> [Metadata] -> X ()
- pickPlayListItem :: RunMPD -> XPConfig -> X ()
- type RunMPD = forall a. MPD a -> IO (Response a)
- findOrAdd :: Song -> MPD Int

# Usage

To use this, import the following modules:

    import XMonad.Prompt.MPD
    import qualified Network.MPD as MPD

You can then use this in a keybinding, to filter first by artist, then by album and add the matching songs:

    addMatching MPD.withMPD defaultXPConfig [MPD.Artist, MPD.Album] >> return ()

That way you will first be asked for an artist name, then for an album by that artist etc..

If you need a password to connect to your MPD or need a different host/port, you can pass a partially applied withMPDEx to the function:

    addMatching (MPD.withMPDEx "your.host" 4242 "very secret") ..

findMatching :: RunMPD -> XPConfig -> [Metadata] -> X [Song] Source #

Lets the user filter out non-matching songs. For example, if given [Artist, Album] as third argument, this will prompt the user for an artist(with tab-completion), then for an album by that artist and then returns the songs from that album.

findMatchingWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X [Song] Source #

Lets the user filter out non-matching songs. For example, if given [Artist, Album] as third argument, this will prompt the user for an artist(with tab-completion), then for an album by that artist and then returns the songs from that album.

Since: 0.13.2

addMatching :: RunMPD -> XPConfig -> [Metadata] -> X [Int] Source #

Add all selected songs to the playlist if they are not in it.

addMatchingWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X [Int] Source #

Add all selected songs to the playlist if they are not in it.

Since: 0.13.2

addAndPlay :: RunMPD -> XPConfig -> [Metadata] -> X () Source #

Add matching songs and play the first one.

addAndPlayWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> [Metadata] -> X () Source #

Add matching songs and play the first one.

Since: 0.13.2

loadPlaylist :: RunMPD -> XPConfig -> X () Source #

Load an existing playlist and play it.

loadPlaylistWith :: (String -> String -> Bool) -> RunMPD -> XPConfig -> X () Source #

Load an existing playlist and play it.

Since: 0.13.2

addAndPlayAny :: RunMPD -> XPConfig -> [Metadata] -> X () Source #

Add songs which match all of the given words with regard to any of the metadata.

Since: 0.13.2

pickPlayListItem :: RunMPD -> XPConfig -> X () Source #

Pick a song from the current playlist.

Since: 0.13.2

type RunMPD = forall a. MPD a -> IO (Response a) Source #

Allows the user to supply a custom way to connect to MPD (e.g. partially applied withMPDEx).

findOrAdd :: Song -> MPD Int Source #

Determine playlist position of the song and add it, if it isn't present.