From 8c4683faa1c26b046c7f70d8242aa06bb6c1e638 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 21 Nov 2021 23:59:38 -0500 Subject: [PATCH] REF rename DBus types --- bin/xmobar.hs | 10 +++++----- lib/XMonad/Internal/Concurrent/Removable.hs | 2 +- lib/XMonad/Internal/DBus/Brightness/Common.hs | 2 +- lib/XMonad/Internal/DBus/Screensaver.hs | 2 +- lib/XMonad/Internal/Dependency.hs | 18 +++++++++--------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/xmobar.hs b/bin/xmobar.hs index e02dbe3..8a2d2b7 100644 --- a/bin/xmobar.hs +++ b/bin/xmobar.hs @@ -312,7 +312,7 @@ type BarFeature = Feature CmdSpec getVPN :: Maybe Client -> BarFeature getVPN client = Feature - { ftrAction = DBusEndpoint_ (const vpnCmd) client [ep] [dp] + { ftrAction = DBusEndpoint (const vpnCmd) client [ep] [dp] , ftrName = "VPN status indicator" , ftrWarning = Default } @@ -322,7 +322,7 @@ getVPN client = Feature getBt :: Maybe Client -> BarFeature getBt client = Feature - { ftrAction = DBusEndpoint_ (const btCmd) client [ep] [] + { ftrAction = DBusEndpoint (const btCmd) client [ep] [] , ftrName = "bluetooth status indicator" , ftrWarning = Default } @@ -338,21 +338,21 @@ getAlsa = Feature getBl :: Maybe Client -> BarFeature getBl client = Feature - { ftrAction = DBusEndpoint_ (const blCmd) client [intelBacklightSignalDep] [] + { ftrAction = DBusEndpoint (const blCmd) client [intelBacklightSignalDep] [] , ftrName = "Intel backlight indicator" , ftrWarning = Default } getCk :: Maybe Client -> BarFeature getCk client = Feature - { ftrAction = DBusEndpoint_ (const ckCmd) client [clevoKeyboardSignalDep] [] + { ftrAction = DBusEndpoint (const ckCmd) client [clevoKeyboardSignalDep] [] , ftrName = "Clevo keyboard indicator" , ftrWarning = Default } getSs :: Maybe Client -> BarFeature getSs client = Feature - { ftrAction = DBusEndpoint_ (const ssCmd) client [ssSignalDep] [] + { ftrAction = DBusEndpoint (const ssCmd) client [ssSignalDep] [] , ftrName = "screensaver indicator" , ftrWarning = Default } diff --git a/lib/XMonad/Internal/Concurrent/Removable.hs b/lib/XMonad/Internal/Concurrent/Removable.hs index a1fc157..f88847c 100644 --- a/lib/XMonad/Internal/Concurrent/Removable.hs +++ b/lib/XMonad/Internal/Concurrent/Removable.hs @@ -90,7 +90,7 @@ listenDevices = do runRemovableMon :: Maybe Client -> FeatureIO runRemovableMon client = Feature - { ftrAction = DBusEndpoint_ (const listenDevices) client [addedDep, removedDep] [] + { ftrAction = DBusEndpoint (const listenDevices) client [addedDep, removedDep] [] , ftrName = "removeable device monitor" , ftrWarning = Default } diff --git a/lib/XMonad/Internal/DBus/Brightness/Common.hs b/lib/XMonad/Internal/DBus/Brightness/Common.hs index 38aef95..8e2d516 100644 --- a/lib/XMonad/Internal/DBus/Brightness/Common.hs +++ b/lib/XMonad/Internal/DBus/Brightness/Common.hs @@ -91,7 +91,7 @@ matchSignal BrightnessConfig { bcPath = p, bcInterface = i } cb = do brightnessExporter :: RealFrac b => [Dependency] -> BrightnessConfig a b -> Maybe Client -> FeatureIO brightnessExporter deps bc@BrightnessConfig { bcName = n } client = Feature - { ftrAction = DBusBus_ (exportBrightnessControls' bc) xmonadBusName client deps + { ftrAction = DBusBus (exportBrightnessControls' bc) xmonadBusName client deps , ftrName = n ++ " exporter" , ftrWarning = Default } diff --git a/lib/XMonad/Internal/DBus/Screensaver.hs b/lib/XMonad/Internal/DBus/Screensaver.hs index 09129ea..d564eb7 100644 --- a/lib/XMonad/Internal/DBus/Screensaver.hs +++ b/lib/XMonad/Internal/DBus/Screensaver.hs @@ -95,7 +95,7 @@ bodyGetCurrentState _ = Nothing exportScreensaver :: Maybe Client -> FeatureIO exportScreensaver client = Feature - { ftrAction = DBusBus_ cmd xmonadBusName client [Executable ssExecutable] + { ftrAction = DBusBus cmd xmonadBusName client [Executable ssExecutable] , ftrName = "screensaver interface" , ftrWarning = Default } diff --git a/lib/XMonad/Internal/Dependency.hs b/lib/XMonad/Internal/Dependency.hs index 688cb45..3570bc3 100644 --- a/lib/XMonad/Internal/Dependency.hs +++ b/lib/XMonad/Internal/Dependency.hs @@ -79,14 +79,14 @@ data Feature a = Feature data Action a = Parent a [Dependency] | forall b. Chain (b -> a) (IO (Either [String] b)) - | DBusEndpoint_ (Client -> a) (Maybe Client) [Endpoint] [Dependency] - | DBusBus_ (Client -> a) BusName (Maybe Client) [Dependency] + | DBusEndpoint (Client -> a) (Maybe Client) [Endpoint] [Dependency] + | DBusBus (Client -> a) BusName (Maybe Client) [Dependency] instance Functor Action where fmap f (Parent a ds) = Parent (f a) ds fmap f (Chain a b) = Chain (f . a) b - fmap f (DBusEndpoint_ a c es ds) = DBusEndpoint_ (f . a) c es ds - fmap f (DBusBus_ a b c eps) = DBusBus_ (f . a) b c eps + fmap f (DBusEndpoint a c es ds) = DBusEndpoint (f . a) c es ds + fmap f (DBusBus a b c eps) = DBusBus (f . a) b c eps -- TODO this is silly as is, and could be made more useful by representing -- loglevels @@ -121,7 +121,7 @@ featureExeArgs n cmd args = featureEndpoint :: BusName -> ObjectPath -> InterfaceName -> MemberName -> Maybe Client -> FeatureIO featureEndpoint busname path iface mem client = Feature - { ftrAction = DBusEndpoint_ cmd client deps [] + { ftrAction = DBusEndpoint cmd client deps [] , ftrName = "screensaver toggle" , ftrWarning = Default } @@ -150,16 +150,16 @@ evalAction (Parent a ds) = do evalAction (Chain a b) = second a <$> b -evalAction (DBusEndpoint_ _ Nothing _ _) = return $ Left ["client not available"] -evalAction (DBusEndpoint_ action (Just client) es ds) = do +evalAction (DBusEndpoint _ Nothing _ _) = return $ Left ["client not available"] +evalAction (DBusEndpoint action (Just client) es ds) = do eperrors <- mapM (endpointSatisfied client) es dperrors <- mapM evalDependency ds return $ case catMaybes (eperrors ++ dperrors) of [] -> Right $ action client es' -> Left es' -evalAction (DBusBus_ _ _ Nothing _) = return $ Left ["client not available"] -evalAction (DBusBus_ action busname (Just client) deps) = do +evalAction (DBusBus _ _ Nothing _) = return $ Left ["client not available"] +evalAction (DBusBus action busname (Just client) deps) = do res <- busSatisfied client busname es <- catMaybes . (res:) <$> mapM evalDependency deps return $ case es of