From f39762e1e8832213ee4bf3f119d86b44afe8d0b3 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Fri, 30 Dec 2022 16:59:50 -0500 Subject: [PATCH] ENH generalize device plugin --- lib/Xmobar/Plugins/Device.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Xmobar/Plugins/Device.hs b/lib/Xmobar/Plugins/Device.hs index 42e992b..1c309ae 100644 --- a/lib/Xmobar/Plugins/Device.hs +++ b/lib/Xmobar/Plugins/Device.hs @@ -12,11 +12,11 @@ module Xmobar.Plugins.Device ) where -import Control.Monad import DBus import Data.Internal.DBus import Data.Internal.Dependency import Data.Word +import RIO import qualified RIO.Text as T import XMonad.Internal.Command.Desktop import XMonad.Internal.DBus.Common @@ -45,7 +45,7 @@ devDep = Endpoint networkManagerPkgs networkManagerBus nmPath nmInterface $ Method_ getByIP -getDevice :: SysClient -> T.Text -> IO (Maybe ObjectPath) +getDevice :: MonadUnliftIO m => SysClient -> T.Text -> m (Maybe ObjectPath) getDevice sys iface = bodyToMaybe <$> callMethod' sys mc where mc = @@ -53,7 +53,7 @@ getDevice sys iface = bodyToMaybe <$> callMethod' sys mc { methodCallBody = [toVariant iface] } -getDeviceConnected :: ObjectPath -> SysClient -> IO [Variant] +getDeviceConnected :: MonadUnliftIO m => ObjectPath -> SysClient -> m [Variant] getDeviceConnected path = callPropertyGet networkManagerBus path nmDeviceInterface $ memberName_ $