diff options
author | jao <jao@gnu.org> | 2025-06-04 04:27:25 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-06-04 04:27:56 +0100 |
commit | 404073416c5f97ab8b82aa436b4f862d349c0dad (patch) | |
tree | b2dde616b7af66384161dc518eeec0eb544dabb4 | |
parent | bdc06e23672f9fc4a99261a0a6bba400ef7358b3 (diff) | |
download | xmobar-404073416c5f97ab8b82aa436b4f862d349c0dad.tar.gz xmobar-404073416c5f97ab8b82aa436b4f862d349c0dad.tar.bz2 |
MPD compilable again by default with all_extensions
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | doc/plugins.org | 4 | ||||
-rw-r--r-- | readme.org | 7 | ||||
-rw-r--r-- | src/Xmobar/Plugins/Monitors/MPD.hs | 5 | ||||
-rw-r--r-- | xmobar.cabal | 6 |
5 files changed, 9 insertions, 14 deletions
diff --git a/changelog.md b/changelog.md index 93fd5d7..ffaca33 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ the zero updates case - `Accordion`: new constructor to allow short version to have plugins too - `Swap`: update for FreeBSD 15 +- `MPD` compiled again by default with `all_extensions`. ## Version 0.49 (April, 2025) diff --git a/doc/plugins.org b/doc/plugins.org index 6f474e1..5cc7e79 100644 --- a/doc/plugins.org +++ b/doc/plugins.org @@ -1077,8 +1077,8 @@ ** Music monitors *** =MPD Args RefreshRate= - - This monitor will only be compiled if you ask for it using the - =with_mpd= flag. It needs [[http://hackage.haskell.org/package/libmpd/][libmpd]] 5.0 or later (available on Hackage). + - This monitor will only be compiled if you ask for it using the =with_mpd= + flag. It needs [[http://hackage.haskell.org/package/libmpd/][libmpd]] 0.10.1 or later (available on Hackage). - Aliases to =mpd= @@ -28,13 +28,6 @@ channel, ~#xmobar~, at [[ircs://irc.libera.chat][Libera]]. * Breaking news - - Starting with version 0.47.1, we are excluding MPD from the extensions - included with ~all_extensions~ when GHC version is 9.4 or greater, because - that seems to break cabal compilation. However, it's been reported that - in some installations compilation with ~libmpd~ works fine: just add - explicitly the ~with_mpd~ flag to include MPD and check for yourself. - Compilation with stack has also been reported to work. Please see the - comments in issue #679 for details. - Starting with version 0.45, we use cairo/pango as our drawing engine (instead of plain X11/Xft). From a user's point of view, that change should be mostly transparent, except for the facts that it's allowed diff --git a/src/Xmobar/Plugins/Monitors/MPD.hs b/src/Xmobar/Plugins/Monitors/MPD.hs index 7ecbc0c..b091147 100644 --- a/src/Xmobar/Plugins/Monitors/MPD.hs +++ b/src/Xmobar/Plugins/Monitors/MPD.hs @@ -109,8 +109,9 @@ parseMPD (Right st) song opts = do si = stateGlyph s opts vol = int2str $ fromMaybe 0 (M.stVolume st) (p, t) = fromMaybe (0, 0) (M.stTime st) - [lap, len, remain] = map showTime - [floor p, floor t, max 0 (floor t - floor p)] + lap = showTime $ floor p + len = showTime $ floor t + remain = showTime $ max 0 (floor t - floor p) b = if t > 0 then realToFrac $ p / t else 0 plen = int2str $ M.stPlaylistLength st ppos = maybe "" (int2str . (+1)) $ M.stSongPos st diff --git a/xmobar.cabal b/xmobar.cabal index a413c29..e6ad605 100644 --- a/xmobar.cabal +++ b/xmobar.cabal @@ -1,5 +1,5 @@ name: xmobar -version: 0.49 +version: 0.50 homepage: https://codeberg.org/xmobar/xmobar synopsis: A Minimalistic Text Based Status Bar description: Xmobar is a minimalistic text based status bar. @@ -266,8 +266,8 @@ library cereal >= 0.5.8.1 cpp-options: -DUSE_NL80211 - if flag(with_mpd) || (flag(all_extensions) && impl(ghc < 9.4)) - build-depends: libmpd >= 0.9.2.0 + if flag(with_mpd) || flag(all_extensions) + build-depends: libmpd >= 0.10.0.1 other-modules: Xmobar.Plugins.Monitors.MPD cpp-options: -DLIBMPD |