REF clean dead code

This commit is contained in:
Nathan Dwarshuis 2021-11-22 00:08:12 -05:00
parent 8c4683faa1
commit e3a7191ed9
7 changed files with 5 additions and 43 deletions

View File

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

View File

@ -113,7 +113,6 @@ stateFileDep = pathRW stateFile
brightnessFileDep :: Dependency
brightnessFileDep = pathR brightnessFile
-- clevoKeyboardSignalDep :: Dependency
clevoKeyboardSignalDep :: Endpoint
clevoKeyboardSignalDep = signalDep clevoKeyboardConfig

View File

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

View File

@ -95,7 +95,6 @@ curFileDep = pathRW curFile
maxFileDep :: Dependency
maxFileDep = pathR maxFile
-- intelBacklightSignalDep :: Dependency
intelBacklightSignalDep :: Endpoint
intelBacklightSignalDep = signalDep intelBacklightConfig

View File

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

View File

@ -9,7 +9,6 @@ module XMonad.Internal.DBus.Control
, getDBusClient
, stopXMonadService
, pathExists
-- , xmonadBus
, disconnect
) where

View File

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