REF clean dead code
This commit is contained in:
parent
8c4683faa1
commit
e3a7191ed9
|
@ -33,16 +33,12 @@ memAdded = memberName_ "InterfacesAdded"
|
|||
memRemoved :: MemberName
|
||||
memRemoved = memberName_ "InterfacesRemoved"
|
||||
|
||||
-- dbusDep :: MemberName -> Dependency
|
||||
-- dbusDep m = DBusEndpoint (Bus True bus) (Endpoint path interface $ Signal_ m)
|
||||
dbusDep :: MemberName -> Endpoint
|
||||
dbusDep m = Endpoint bus path interface $ Signal_ m
|
||||
|
||||
-- addedDep :: Dependency
|
||||
addedDep :: Endpoint
|
||||
addedDep = dbusDep memAdded
|
||||
|
||||
-- removedDep :: Dependency
|
||||
removedDep :: Endpoint
|
||||
removedDep = dbusDep memRemoved
|
||||
|
||||
|
|
|
@ -113,7 +113,6 @@ stateFileDep = pathRW stateFile
|
|||
brightnessFileDep :: Dependency
|
||||
brightnessFileDep = pathR brightnessFile
|
||||
|
||||
-- clevoKeyboardSignalDep :: Dependency
|
||||
clevoKeyboardSignalDep :: Endpoint
|
||||
clevoKeyboardSignalDep = signalDep clevoKeyboardConfig
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ callGetBrightness BrightnessConfig { bcPath = p, bcInterface = i } client = do
|
|||
reply <- callMethod client xmonadBusName p i memGet
|
||||
return $ either (const Nothing) bodyGetBrightness reply
|
||||
|
||||
-- signalDep :: BrightnessConfig a b -> Dependency
|
||||
signalDep :: BrightnessConfig a b -> Endpoint
|
||||
signalDep BrightnessConfig { bcPath = p, bcInterface = i } =
|
||||
Endpoint xmonadBusName p i $ Signal_ memCur
|
||||
|
|
|
@ -95,7 +95,6 @@ curFileDep = pathRW curFile
|
|||
maxFileDep :: Dependency
|
||||
maxFileDep = pathR maxFile
|
||||
|
||||
-- intelBacklightSignalDep :: Dependency
|
||||
intelBacklightSignalDep :: Endpoint
|
||||
intelBacklightSignalDep = signalDep intelBacklightConfig
|
||||
|
||||
|
|
|
@ -2,46 +2,16 @@
|
|||
-- | Common internal DBus functions
|
||||
|
||||
module XMonad.Internal.DBus.Common
|
||||
-- ( callMethod
|
||||
-- , callMethod'
|
||||
( addMatchCallback
|
||||
-- , xmonadBus
|
||||
, xmonadBusName
|
||||
-- , xDbusDep
|
||||
-- , initControls
|
||||
) where
|
||||
|
||||
import DBus
|
||||
import DBus.Client
|
||||
|
||||
-- import XMonad.Internal.Dependency
|
||||
|
||||
xmonadBusName :: BusName
|
||||
xmonadBusName = busName_ "org.xmonad"
|
||||
|
||||
-- xmonadBus :: Bus
|
||||
-- xmonadBus = Bus False xmonadBusName
|
||||
|
||||
-- xDbusDep :: ObjectPath -> InterfaceName -> DBusMember -> Dependency
|
||||
-- xDbusDep o i m = DBusEndpoint xmonadBus $ Endpoint o i m
|
||||
|
||||
-- -- | Call a method and return its result if successful
|
||||
-- callMethod :: MethodCall -> IO (Maybe [Variant])
|
||||
-- callMethod mc = do
|
||||
-- client <- connectSession
|
||||
-- r <- callMethod' client (Just xmonadBusName) mc
|
||||
-- disconnect client
|
||||
-- return r
|
||||
|
||||
-- callMethod' :: Client -> Maybe BusName -> MethodCall -> IO (Maybe [Variant])
|
||||
-- callMethod' client bn mc = do
|
||||
-- -- TODO handle clienterrors here
|
||||
-- reply <- call client mc { methodCallDestination = bn }
|
||||
-- -- TODO not all methods warrant that we wait for a reply? (see callNoReply)
|
||||
-- return $ case reply of
|
||||
-- Left _ -> Nothing
|
||||
-- Right ret -> Just $ methodReturnBody ret
|
||||
|
||||
-- | Bind a callback to a signal match rule
|
||||
addMatchCallback :: MatchRule -> ([Variant] -> IO ()) -> IO SignalHandler
|
||||
addMatchCallback rule cb = do
|
||||
|
|
|
@ -9,7 +9,6 @@ module XMonad.Internal.DBus.Control
|
|||
, getDBusClient
|
||||
, stopXMonadService
|
||||
, pathExists
|
||||
-- , xmonadBus
|
||||
, disconnect
|
||||
) where
|
||||
|
||||
|
|
|
@ -71,9 +71,9 @@ import XMonad.Internal.Shell
|
|||
-- robust anyways, at the cost of being a bit slower.
|
||||
|
||||
data Feature a = Feature
|
||||
{ ftrAction :: Action a
|
||||
, ftrName :: String
|
||||
, ftrWarning :: Warning
|
||||
{ ftrAction :: Action a
|
||||
, ftrName :: String
|
||||
, ftrWarning :: Warning
|
||||
}
|
||||
| ConstFeature a
|
||||
|
||||
|
@ -83,8 +83,8 @@ data Action a = Parent a [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 (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
|
||||
|
||||
|
|
Loading…
Reference in New Issue