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

CopyrightDaniel Schoepe <daniel.schoepe@googlemail.com>
LicenseBSD3-style (see LICENSE)
MaintainerDaniel Schoepe <daniel.schoepe@googlemail.com>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

XMonad.Prompt.MPD

Contents

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

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.

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

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

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

Add matching songs and play the first one.

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.