diff --git a/lib/Xmobar/Plugins/VPN.hs b/lib/Xmobar/Plugins/VPN.hs index 3ccf837..309938e 100644 --- a/lib/Xmobar/Plugins/VPN.hs +++ b/lib/Xmobar/Plugins/VPN.hs @@ -53,12 +53,12 @@ type VPNState = S.Set ObjectPath type MutableVPNState = MVar VPNState -initState :: SysClient -> IO MutableVPNState +initState :: MonadUnliftIO m => SysClient -> m MutableVPNState initState client = do ot <- getVPNObjectTree client newMVar $ findTunnels ot -readState :: MutableVPNState -> IO Bool +readState :: MonadUnliftIO m => MutableVPNState -> m Bool readState = fmap (not . null) . readMVar updateState @@ -72,7 +72,7 @@ updateState f state op = modifyMVar_ state $ return . f op -------------------------------------------------------------------------------- -- Tunnel Device Detection -getVPNObjectTree :: SysClient -> IO ObjectTree +getVPNObjectTree :: MonadUnliftIO m => SysClient -> m ObjectTree getVPNObjectTree sys = callGetManagedObjects sys vpnBus vpnPath findTunnels :: ObjectTree -> VPNState