ENH generalize device plugin

This commit is contained in:
Nathan Dwarshuis 2022-12-30 16:59:50 -05:00
parent c394a65523
commit f39762e1e8
1 changed files with 3 additions and 3 deletions

View File

@ -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_ $