Hi, Here's an update to the latest version of my favourite X11 status bar.
It requires an update for hs-libmpd (sent in a previous mail). cheers! David Index: Makefile =================================================================== RCS file: /cvs/ports/x11/xmobar/Makefile,v retrieving revision 1.18 diff -u -p -r1.18 Makefile --- Makefile 2 Dec 2012 20:49:28 -0000 1.18 +++ Makefile 24 Jan 2013 10:43:28 -0000 @@ -2,8 +2,7 @@ COMMENT = minimalistic text based status bar -DISTNAME = xmobar-0.15 -REVISION = 3 +DISTNAME = xmobar-0.16 CATEGORIES = x11 HOMEPAGE = http://projects.haskell.org/xmobar @@ -29,7 +28,7 @@ BUILD_DEPENDS = devel/hs-mtl \ x11/hs-X11>=1.3.0 \ x11/hs-X11-xft>=0.2 \ x11/hs-dbus>=0.10 \ - audio/hs-libmpd>=0.5 + audio/hs-libmpd>=0.8 LIB_DEPENDS = textproc/libxml Index: distinfo =================================================================== RCS file: /cvs/ports/x11/xmobar/distinfo,v retrieving revision 1.6 diff -u -p -r1.6 distinfo --- distinfo 26 Sep 2012 07:09:20 -0000 1.6 +++ distinfo 24 Jan 2013 10:43:28 -0000 @@ -1,2 +1,2 @@ -SHA256 (ghc/xmobar-0.15.tar.gz) = lDUlLZ76aAm1SkkMGrIPfFHHRo+epcYwyj/P4VYgQfE= -SIZE (ghc/xmobar-0.15.tar.gz) = 67304 +SHA256 (ghc/xmobar-0.16.tar.gz) = EV1gIBjKIMYrNSBoZPYwCMLt5HOaEimJLIzc/zyfpLc= +SIZE (ghc/xmobar-0.16.tar.gz) = 76102 Index: patches/patch-samples_xmobar_config =================================================================== RCS file: /cvs/ports/x11/xmobar/patches/patch-samples_xmobar_config,v retrieving revision 1.2 diff -u -p -r1.2 patch-samples_xmobar_config --- patches/patch-samples_xmobar_config 26 Sep 2012 07:09:20 -0000 1.2 +++ patches/patch-samples_xmobar_config 24 Jan 2013 10:43:28 -0000 @@ -1,9 +1,13 @@ $OpenBSD: patch-samples_xmobar_config,v 1.2 2012/09/26 07:09:20 dcoppa Exp $ ---- samples/xmobar.config.orig Mon Jun 4 02:55:49 2012 -+++ samples/xmobar.config Mon Sep 24 21:36:56 2012 -@@ -6,15 +6,11 @@ Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" +--- samples/xmobar.config.orig Mon Dec 3 00:47:56 2012 ++++ samples/xmobar.config Thu Jan 24 12:28:53 2013 +@@ -4,18 +4,15 @@ Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" + , bgColor = "black" + , fgColor = "grey" , position = Top ++ , hideOnStart = False , lowerOnStart = True + , persistent = False , commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000 - , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 - , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10 @@ -18,5 +22,5 @@ $OpenBSD: patch-samples_xmobar_config,v , sepChar = "%" , alignSep = "}{" - , template = "%cpu% | %memory% * %swap% | %eth0% - %eth1% }{ <fc=#ee9a00>%date%</fc>| %EGPF% | %uname%" -+ , template = "%battery% }{ <fc=#ee9a00>%date%</fc>| %EGPF% | %uname%" ++ , template = "%battery% }{ <fc=#ee9a00>%date%</fc> | %EGPF% | %uname%" } Index: patches/patch-src_Plugins_Monitors_Mpris_hs =================================================================== RCS file: patches/patch-src_Plugins_Monitors_Mpris_hs diff -N patches/patch-src_Plugins_Monitors_Mpris_hs --- patches/patch-src_Plugins_Monitors_Mpris_hs 22 Oct 2012 12:44:32 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,112 +0,0 @@ -$OpenBSD: patch-src_Plugins_Monitors_Mpris_hs,v 1.1 2012/10/22 12:44:32 dcoppa Exp $ - -Fix the MPRIS plugin to work with DBus >= 0.10 -(upstream git commit 73e70006694a559f816536aae68965b2220fced1) - ---- src/Plugins/Monitors/Mpris.hs.orig Mon Jun 4 02:55:49 2012 -+++ src/Plugins/Monitors/Mpris.hs Fri Oct 12 11:59:09 2012 -@@ -21,54 +21,64 @@ module Plugins.Monitors.Mpris ( mprisConfig, runMPRIS1 - import Plugins.Monitors.Common - - import Text.Printf (printf) --import qualified DBus.Client.Simple as C --import DBus.Types --import DBus.Connection ( ConnectionError ) -+ -+import DBus -+import qualified DBus.Client as DC -+ - import Data.Maybe ( fromJust ) - import Data.Int ( Int32, Int64 ) - import System.IO.Unsafe (unsafePerformIO) --import qualified Data.Text as T - - import Control.Exception (try) - - class MprisVersion a where -- getProxy :: a -> C.Client -> String -> IO C.Proxy -- getMetadataReply :: a -> C.Client -> String -> IO [Variant] -+ getMethodCall :: a -> String -> MethodCall -+ getMetadataReply :: a -> DC.Client -> String -> IO [Variant] -+ getMetadataReply mv c p = fmap methodReturnBody (DC.call_ c $ getMethodCall mv p) - fieldsList :: a -> [String] - - data MprisVersion1 = MprisVersion1 - instance MprisVersion MprisVersion1 where -- getProxy MprisVersion1 c p = do -- let playerBusName = T.concat ["org.mpris.", T.pack p] -- C.proxy c (C.busName_ playerBusName) "/Player" -- getMetadataReply MprisVersion1 c p = do -- player <- getProxy MprisVersion1 c p -- C.call player "org.freedesktop.MediaPlayer" "GetMetadata" [] -- fieldsList MprisVersion1 = [ "album", "artist", "arturl", "mtime", "title", "tracknumber" ] -+ getMethodCall MprisVersion1 p = (methodCall objectPath interfaceName memberName) -+ { methodCallDestination = Just busName -+ } -+ where -+ busName = busName_ $ "org.mpris." ++ p -+ objectPath = objectPath_ $ "/Player" -+ interfaceName = interfaceName_ $ "org.freedesktop.MediaPlayer" -+ memberName = memberName_ $ "GetMetadata" - -+ fieldsList MprisVersion1 = [ "album", "artist", "arturl", "mtime", "title" -+ , "tracknumber" ] -+ - data MprisVersion2 = MprisVersion2 - instance MprisVersion MprisVersion2 where -- getProxy MprisVersion2 c p = do -- let playerBusName = T.concat ["org.mpris.MediaPlayer2.", T.pack p] -- C.proxy c (C.busName_ playerBusName) "/org/mpris/MediaPlayer2" -- getMetadataReply MprisVersion2 c p = do -- player <- getProxy MprisVersion2 c p -- C.call player "org.freedesktop.DBus.Properties" -- "Get" -- (map (toVariant::String -> Variant) -- ["org.mpris.MediaPlayer2.Player", "Metadata"] -- ) -+ getMethodCall MprisVersion2 p = (methodCall objectPath interfaceName memberName) -+ { methodCallDestination = Just busName -+ , methodCallBody = arguments -+ } -+ where -+ busName = busName_ $ "org.mpris.MediaPlayer2." ++ p -+ objectPath = objectPath_ $ "/org/mpris/MediaPlayer2" -+ interfaceName = interfaceName_ $ "org.freedesktop.DBus.Properties" -+ memberName = memberName_ $ "Get" -+ arguments = map (toVariant::String -> Variant) -+ ["org.mpris.MediaPlayer2.Player", "Metadata"] -+ - fieldsList MprisVersion2 = [ "xesam:album", "xesam:artist", "mpris:artUrl" -- , "mpris:length", "xesam:title", "xesam:trackNumber" -+ , "mpris:length", "xesam:title", -+ "xesam:trackNumber", "xesam:composer", -+ "xesam:genre" - ] - - mprisConfig :: IO MConfig - mprisConfig = mkMConfig "<artist> - <title>" -- [ "album", "artist", "arturl", "length" , "title", "tracknumber" -+ [ "album", "artist", "arturl", "length" -+ , "title", "tracknumber" , "composer", "genre" - ] - --dbusClient :: C.Client --dbusClient = unsafePerformIO C.connectSession -+dbusClient :: DC.Client -+dbusClient = unsafePerformIO DC.connectSession - - runMPRIS :: (MprisVersion a) => a -> String -> [String] -> Monitor String - runMPRIS version playerName _ = do -@@ -95,10 +105,10 @@ unpackMetadata xs = ((map (\(k, v) -> (fromVar k, from - TypeStructure _ -> unpack $ head $ structureItems $ fromVar v - _ -> [] - --getMetadata :: (MprisVersion a) => a -> C.Client -> String -> IO [(String, Variant)] -+getMetadata :: (MprisVersion a) => a -> DC.Client -> String -> IO [(String, Variant)] - getMetadata version client player = do - reply <- try (getMetadataReply version client player) :: -- IO (Either ConnectionError [Variant]) -+ IO (Either DC.ClientError [Variant]) - return $ case reply of - Right metadata -> unpackMetadata metadata; - Left _ -> [] Index: patches/patch-src_Plugins_Monitors_hs =================================================================== RCS file: /cvs/ports/x11/xmobar/patches/patch-src_Plugins_Monitors_hs,v retrieving revision 1.3 diff -u -p -r1.3 patch-src_Plugins_Monitors_hs --- patches/patch-src_Plugins_Monitors_hs 26 Sep 2012 07:09:20 -0000 1.3 +++ patches/patch-src_Plugins_Monitors_hs 24 Jan 2013 10:43:28 -0000 @@ -1,9 +1,9 @@ $OpenBSD: patch-src_Plugins_Monitors_hs,v 1.3 2012/09/26 07:09:20 dcoppa Exp $ ---- src/Plugins/Monitors.hs.orig Mon Jun 4 02:55:49 2012 -+++ src/Plugins/Monitors.hs Mon Sep 24 21:36:56 2012 +--- src/Plugins/Monitors.hs.orig Wed Jan 23 17:48:00 2013 ++++ src/Plugins/Monitors.hs Wed Jan 23 17:54:33 2013 @@ -21,20 +21,20 @@ import Plugins - import Plugins.Monitors.Common ( runM ) + import Plugins.Monitors.Common (runM) import Plugins.Monitors.Weather -import Plugins.Monitors.Net -import Plugins.Monitors.Mem @@ -35,64 +35,68 @@ $OpenBSD: patch-src_Plugins_Monitors_hs, #ifdef IWLIB import Plugins.Monitors.Wireless #endif -@@ -49,23 +49,23 @@ import Plugins.Monitors.Mpris +@@ -50,24 +50,24 @@ import Plugins.Monitors.Mpris #endif - data Monitors = Weather Station Args Rate -- | Network Interface Args Rate -- | BatteryP [String] Args Rate -- | DiskU DiskSpec Args Rate -- | DiskIO DiskSpec Args Rate -- | Thermal Zone Args Rate -- | ThermalZone ZoneNo Args Rate -- | Memory Args Rate -- | Swap Args Rate -- | Cpu Args Rate -- | MultiCpu Args Rate -+-- | Network Interface Args Rate -+-- | BatteryP [String] Args Rate -+-- | DiskU DiskSpec Args Rate -+-- | DiskIO DiskSpec Args Rate -+-- | Thermal Zone Args Rate -+-- | ThermalZone ZoneNo Args Rate -+-- | Memory Args Rate -+-- | Swap Args Rate -+-- | Cpu Args Rate -+-- | MultiCpu Args Rate - | Battery Args Rate -- | Brightness Args Rate -- | CpuFreq Args Rate -- | CoreTemp Args Rate -- | TopProc Args Rate -- | TopMem Args Rate -- | Uptime Args Rate -+-- | Brightness Args Rate -+-- | CpuFreq Args Rate -+-- | CoreTemp Args Rate -+-- | TopProc Args Rate -+-- | TopMem Args Rate -+-- | Uptime Args Rate + data Monitors = Weather Station Args Rate +- | Network Interface Args Rate +- | DynNetwork Args Rate +- | BatteryP [String] Args Rate +- | DiskU DiskSpec Args Rate +- | DiskIO DiskSpec Args Rate +- | Thermal Zone Args Rate +- | ThermalZone ZoneNo Args Rate +- | Memory Args Rate +- | Swap Args Rate +- | Cpu Args Rate +- | MultiCpu Args Rate ++-- | Network Interface Args Rate ++-- | DynNetwork Args Rate ++-- | BatteryP [String] Args Rate ++-- | DiskU DiskSpec Args Rate ++-- | DiskIO DiskSpec Args Rate ++-- | Thermal Zone Args Rate ++-- | ThermalZone ZoneNo Args Rate ++-- | Memory Args Rate ++-- | Swap Args Rate ++-- | Cpu Args Rate ++-- | MultiCpu Args Rate + | Battery Args Rate +- | Brightness Args Rate +- | CpuFreq Args Rate +- | CoreTemp Args Rate +- | TopProc Args Rate +- | TopMem Args Rate +- | Uptime Args Rate ++-- | Brightness Args Rate ++-- | CpuFreq Args Rate ++-- | CoreTemp Args Rate ++-- | TopProc Args Rate ++-- | TopMem Args Rate ++-- | Uptime Args Rate #ifdef IWLIB | Wireless Interface Args Rate #endif -@@ -93,23 +93,23 @@ type DiskSpec = [(String, String)] +@@ -96,24 +96,24 @@ type DiskSpec = [(String, String)] instance Exec Monitors where alias (Weather s _ _) = s - alias (Network i _ _) = i +- alias (DynNetwork _ _) = "dynnetwork" - alias (Thermal z _ _) = z - alias (ThermalZone z _ _) = "thermal" ++ show z - alias (Memory _ _) = "memory" - alias (Swap _ _) = "swap" - alias (Cpu _ _) = "cpu" - alias (MultiCpu _ _) = "multicpu" -+-- alias (Network i _ _) = i -+-- alias (Thermal z _ _) = z -+-- alias (ThermalZone z _ _) = "thermal" ++ show z -+-- alias (Memory _ _) = "memory" -+-- alias (Swap _ _) = "swap" -+-- alias (Cpu _ _) = "cpu" -+-- alias (MultiCpu _ _) = "multicpu" ++-- alias (Network i _ _) = i ++-- alias (DynNetwork _ _) = "dynnetwork" ++-- alias (Thermal z _ _) = z ++-- alias (ThermalZone z _ _) = "thermal" ++ show z ++-- alias (Memory _ _) = "memory" ++-- alias (Swap _ _) = "swap" ++-- alias (Cpu _ _) = "cpu" ++-- alias (MultiCpu _ _) = "multicpu" alias (Battery _ _) = "battery" - alias (BatteryP _ _ _)= "battery" - alias (Brightness _ _) = "bright" @@ -103,43 +107,45 @@ $OpenBSD: patch-src_Plugins_Monitors_hs, - alias (DiskU _ _ _) = "disku" - alias (DiskIO _ _ _) = "diskio" - alias (Uptime _ _) = "uptime" -+-- alias (BatteryP _ _ _)= "battery" -+-- alias (Brightness _ _) = "bright" -+-- alias (CpuFreq _ _) = "cpufreq" -+-- alias (TopProc _ _) = "top" -+-- alias (TopMem _ _) = "topmem" -+-- alias (CoreTemp _ _) = "coretemp" -+-- alias (DiskU _ _ _) = "disku" -+-- alias (DiskIO _ _ _) = "diskio" -+-- alias (Uptime _ _) = "uptime" ++-- alias (BatteryP _ _ _)= "battery" ++-- alias (Brightness _ _) = "bright" ++-- alias (CpuFreq _ _) = "cpufreq" ++-- alias (TopProc _ _) = "top" ++-- alias (TopMem _ _) = "topmem" ++-- alias (CoreTemp _ _) = "coretemp" ++-- alias (DiskU _ _ _) = "disku" ++-- alias (DiskIO _ _ _) = "diskio" ++-- alias (Uptime _ _) = "uptime" #ifdef IWLIB alias (Wireless i _ _) = i ++ "wi" #endif -@@ -123,25 +123,25 @@ instance Exec Monitors where +@@ -128,26 +128,26 @@ instance Exec Monitors where alias (Mpris1 _ _ _) = "mpris1" alias (Mpris2 _ _ _) = "mpris2" #endif - start (Network i a r) = startNet i a r +- start (DynNetwork a r) = startDynNet a r - start (Cpu a r) = startCpu a r - start (MultiCpu a r) = startMultiCpu a r - start (TopProc a r) = startTop a r - start (TopMem a r) = runM a topMemConfig runTopMem r -+-- start (Network i a r) = startNet i a r -+-- start (Cpu a r) = startCpu a r -+-- start (MultiCpu a r) = startMultiCpu a r -+-- start (TopProc a r) = startTop a r -+-- start (TopMem a r) = runM a topMemConfig runTopMem r ++-- start (Network i a r) = startNet i a r ++-- start (DynNetwork a r) = startDynNet a r ++-- start (Cpu a r) = startCpu a r ++-- start (MultiCpu a r) = startMultiCpu a r ++-- start (TopProc a r) = startTop a r ++-- start (TopMem a r) = runM a topMemConfig runTopMem r start (Weather s a r) = runM (a ++ [s]) weatherConfig runWeather r - start (Thermal z a r) = runM (a ++ [z]) thermalConfig runThermal r - start (ThermalZone z a r) = - runM (a ++ [show z]) thermalZoneConfig runThermalZone r - start (Memory a r) = runM a memConfig runMem r - start (Swap a r) = runM a swapConfig runSwap r -+-- start (Thermal z a r) = runM (a ++ [z]) thermalConfig runThermal r -+-- start (ThermalZone z a r) = -+-- runM (a ++ [show z]) thermalZoneConfig runThermalZone r -+-- start (Memory a r) = runM a memConfig runMem r -+-- start (Swap a r) = runM a swapConfig runSwap r ++-- start (Thermal z a r) = runM (a ++ [z]) thermalConfig runThermal r ++-- start (ThermalZone z a r) = ++-- runM (a ++ [show z]) thermalZoneConfig runThermalZone r ++-- start (Memory a r) = runM a memConfig runMem r ++-- start (Swap a r) = runM a swapConfig runSwap r start (Battery a r) = runM a battConfig runBatt r - start (BatteryP s a r) = runM a battConfig (runBatt' s) r - start (Brightness a r) = runM a brightConfig runBright r @@ -148,13 +154,13 @@ $OpenBSD: patch-src_Plugins_Monitors_hs, - start (DiskU s a r) = runM a diskUConfig (runDiskU s) r - start (DiskIO s a r) = startDiskIO s a r - start (Uptime a r) = runM a uptimeConfig runUptime r -+-- start (BatteryP s a r) = runM a battConfig (runBatt' s) r -+-- start (Brightness a r) = runM a brightConfig runBright r -+-- start (CpuFreq a r) = runM a cpuFreqConfig runCpuFreq r -+-- start (CoreTemp a r) = runM a coreTempConfig runCoreTemp r -+-- start (DiskU s a r) = runM a diskUConfig (runDiskU s) r -+-- start (DiskIO s a r) = startDiskIO s a r -+-- start (Uptime a r) = runM a uptimeConfig runUptime r ++-- start (BatteryP s a r) = runM a battConfig (runBatt' s) r ++-- start (Brightness a r) = runM a brightConfig runBright r ++-- start (CpuFreq a r) = runM a cpuFreqConfig runCpuFreq r ++-- start (CoreTemp a r) = runM a coreTempConfig runCoreTemp r ++-- start (DiskU s a r) = runM a diskUConfig (runDiskU s) r ++-- start (DiskIO s a r) = startDiskIO s a r ++-- start (Uptime a r) = runM a uptimeConfig runUptime r #ifdef IWLIB start (Wireless i a r) = runM (a ++ [i]) wirelessConfig runWireless r #endif Index: patches/patch-xmobar_cabal =================================================================== RCS file: /cvs/ports/x11/xmobar/patches/patch-xmobar_cabal,v retrieving revision 1.6 diff -u -p -r1.6 patch-xmobar_cabal --- patches/patch-xmobar_cabal 2 Dec 2012 20:49:28 -0000 1.6 +++ patches/patch-xmobar_cabal 24 Jan 2013 10:43:28 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-xmobar_cabal,v 1.6 2012/12/02 20:49:28 kili Exp $ ---- xmobar.cabal.orig Mon Jun 4 02:55:49 2012 -+++ xmobar.cabal Sat Dec 1 13:27:58 2012 -@@ -85,9 +85,10 @@ executable xmobar +--- xmobar.cabal.orig Mon Dec 3 00:47:56 2012 ++++ xmobar.cabal Thu Jan 24 12:13:50 2013 +@@ -88,10 +88,11 @@ executable xmobar Plugins.Monitors.Swap, Plugins.Monitors.Thermal, Plugins.Monitors.ThermalZone, Plugins.Monitors.Top, Plugins.Monitors.Uptime, Plugins.Monitors.Weather, @@ -9,27 +9,8 @@ $OpenBSD: patch-xmobar_cabal,v 1.6 2012/ + Plugins.Monitors.Bright, Plugins.Monitors.Batt.Binding ghc-prof-options: -prof -auto-all -+ c-sources: src/Plugins/Monitors/Batt/apm.c + ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind ++ c-sources: src/Plugins/Monitors/Batt/apm.c + extra-libraries: Xrandr - if true - ghc-options: -funbox-strict-fields -Wall -@@ -112,9 +113,9 @@ executable xmobar - time, - filepath, - X11 == 1.6.*, -- mtl == 2.0.*, -+ mtl, - parsec == 3.1.*, -- stm == 2.3.* -+ stm - - if flag(small_base) - build-depends: -@@ -162,6 +163,6 @@ executable xmobar - cpp-options: -DDATEZONE - - if flag(with_mpris) || flag(all_extensions) -- build-depends: dbus-core >= 0.9.2.1, text >= 0.11.1.5 && < 0.12 -+ build-depends: dbus >= 0.10 - other-modules: Plugins.Monitors.Mpris - cpp-options: -DMPRIS + build-depends: Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/x11/xmobar/pkg/PLIST,v retrieving revision 1.2 diff -u -p -r1.2 PLIST --- pkg/PLIST 17 Jul 2010 14:55:21 -0000 1.2 +++ pkg/PLIST 24 Jan 2013 10:43:28 -0000 @@ -1,6 +1,6 @@ @comment $OpenBSD: PLIST,v 1.2 2010/07/17 14:55:21 kili Exp $ @bin bin/xmobar -@comment share/doc/${DISTNAME}/ -@comment share/doc/${DISTNAME}/LICENSE +@comment share/doc/${FULLPKGNAME}/ +@comment share/doc/${FULLPKGNAME}/license share/examples/xmobar/ share/examples/xmobar/xmobarrc