xmonad-spotify 0.1.0.1 → 0.1.1.0
raw patch · 4 files changed
+23/−26 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ XMonad.Util.Spotify: audioStop :: MonadIO m => m ()
Files
- CHANGELOG.md +6/−2
- cabal.project.local +0/−5
- src/XMonad/Util/Spotify.hs +12/−14
- xmonad-spotify.cabal +5/−5
CHANGELOG.md view
@@ -1,9 +1,13 @@ # xmonad-spotify +## 0.1.1.0++ * Add `audioStop` and add appropriate keybindings+ ## 0.1.0.1 -* Generalize type signatures-* Remove dependency on `xmonad-contrib` and `xmonad`+ * Generalize type signatures+ * Remove dependency on `xmonad-contrib` and `xmonad` ## 0.1.0.0
cabal.project.local view
@@ -2,8 +2,3 @@ allow-newer: base Cabal---- source-repository-package- -- location: https://github.com/rblaze/haskell-dbus- -- type: git- -- tag: 6f923bfd2c7ee58bee5281e9006fe92a42f49774
src/XMonad/Util/Spotify.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE TupleSections #-}- -- | Bind media keys for Spotify using @dbus@. module XMonad.Util.Spotify ( -- * default keybindings mediaKeys@@ -7,9 +5,9 @@ , audioPrev , audioNext , audioPlayPause+ , audioStop ) where -import Control.Arrow (first) import Control.Monad.IO.Class import qualified Data.Map as M import DBus@@ -24,23 +22,20 @@ where mediaKeyMap = M.fromList mediaKeyList mediaKeyList :: MonadIO m => [((KeyMask, KeySym), m ())]-mediaKeyList = go <$> [ (xF86XK_AudioNext, audioNext)- , (xF86XK_AudioPrev, audioPrev)- , (xF86XK_AudioPlay, audioPlayPause)- ]- where go = first (0 ,)+mediaKeyList = [ ((0, xF86XK_AudioNext), audioNext)+ , ((0, xF86XK_AudioPrev), audioPrev)+ , ((0, xF86XK_AudioPlay), audioPlayPause)+ , ((0, xF86XK_AudioStop), audioStop)+ ] -spIO :: String -> IO ()-spIO str = do+-- FIXME: don't connect one session each time?+sp :: MonadIO m => String -> m ()+sp str = liftIO $ do client <- connectSession _ <- call_ client (methodCall (objectPath_ "/org/mpris/MediaPlayer2") (interfaceName_ "org.mpris.MediaPlayer2.Player") (memberName_ str)) { methodCallDestination = Just (busName_ "org.mpris.MediaPlayer2.spotify") } disconnect client --- | Helper function for use with dbus-sp :: MonadIO m => String -> m ()-sp = liftIO . spIO- -- | Action in the 'X' monad to go to next audioNext :: MonadIO m => m () audioNext = sp "Next"@@ -52,3 +47,6 @@ -- | Action in the 'X' monad to play/pause audioPlayPause :: MonadIO m => m () audioPlayPause = sp "PlayPause"++audioStop :: MonadIO m => m ()+audioStop = sp "Stop"
xmonad-spotify.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: xmonad-spotify-version: 0.1.0.1+version: 0.1.1.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale@@ -37,17 +37,17 @@ dbus -any, containers -any, X11 -any- + if flag(development) ghc-options: -Werror- + if !impl(ghc >=8.0) build-depends: transformers -any- + if impl(ghc >=8.0) ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -Widentities- + if impl(ghc >=8.4) ghc-options: -Wmissing-export-lists