summaryrefslogtreecommitdiffstats
path: root/src/XMonad/Local/Music.hs
diff options
context:
space:
mode:
authorMichal Minar <mic.liamg@gmail.com>2015-08-29 14:36:39 +0200
committerMichal Minar <mic.liamg@gmail.com>2015-08-29 14:36:39 +0200
commit5aa4dbc8777612dc2223a00e85acf62b886a40b8 (patch)
treebf023168635c8c5fe20311131ad536487f99bce0 /src/XMonad/Local/Music.hs
parent4039213b0fa187c614801eb21d8578d902ea267e (diff)
downloadxminad-5aa4dbc8777612dc2223a00e85acf62b886a40b8.tar.gz
xminad-5aa4dbc8777612dc2223a00e85acf62b886a40b8.tar.xz
xminad-5aa4dbc8777612dc2223a00e85acf62b886a40b8.zip
Added keybindings for mpd control
Signed-off-by: Michal Minar <mic.liamg@gmail.com>
Diffstat (limited to 'src/XMonad/Local/Music.hs')
-rw-r--r--src/XMonad/Local/Music.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/XMonad/Local/Music.hs b/src/XMonad/Local/Music.hs
new file mode 100644
index 0000000..d55fbbc
--- /dev/null
+++ b/src/XMonad/Local/Music.hs
@@ -0,0 +1,15 @@
+module XMonad.Local.Music where
+
+import Control.Monad (liftM)
+
+import qualified Network.MPD as MPD
+
+toggleRepeat :: MPD.MonadMPD m => m()
+toggleRepeat = do
+ repeatState <- liftM MPD.stRepeat MPD.status
+ MPD.repeat $ not repeatState
+
+toggleRandom :: MPD.MonadMPD m => m()
+toggleRandom = do
+ randomState <- liftM MPD.stRandom MPD.status
+ MPD.random $ not randomState