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
memRemoved = memberName_ "InterfacesRemoved" memRemoved = memberName_ "InterfacesRemoved"
-- dbusDep :: MemberName -> Dependency
-- dbusDep m = DBusEndpoint (Bus True bus) (Endpoint path interface $ Signal_ m)
dbusDep :: MemberName -> Endpoint dbusDep :: MemberName -> Endpoint
dbusDep m = Endpoint bus path interface $ Signal_ m dbusDep m = Endpoint bus path interface $ Signal_ m
-- addedDep :: Dependency
addedDep :: Endpoint addedDep :: Endpoint
addedDep = dbusDep memAdded addedDep = dbusDep memAdded
-- removedDep :: Dependency
removedDep :: Endpoint removedDep :: Endpoint
removedDep = dbusDep memRemoved removedDep = dbusDep memRemoved

View File

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

View File

@ -67,7 +67,6 @@ callGetBrightness BrightnessConfig { bcPath = p, bcInterface = i } client = do
reply <- callMethod client xmonadBusName p i memGet reply <- callMethod client xmonadBusName p i memGet
return $ either (const Nothing) bodyGetBrightness reply return $ either (const Nothing) bodyGetBrightness reply
-- signalDep :: BrightnessConfig a b -> Dependency
signalDep :: BrightnessConfig a b -> Endpoint signalDep :: BrightnessConfig a b -> Endpoint
signalDep BrightnessConfig { bcPath = p, bcInterface = i } = signalDep BrightnessConfig { bcPath = p, bcInterface = i } =
Endpoint xmonadBusName p i $ Signal_ memCur Endpoint xmonadBusName p i $ Signal_ memCur

View File

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

View File

@ -2,46 +2,16 @@
-- | Common internal DBus functions -- | Common internal DBus functions
module XMonad.Internal.DBus.Common module XMonad.Internal.DBus.Common
-- ( callMethod
-- , callMethod'
( addMatchCallback ( addMatchCallback
-- , xmonadBus
, xmonadBusName , xmonadBusName
-- , xDbusDep
-- , initControls
) where ) where
import DBus import DBus
import DBus.Client import DBus.Client
-- import XMonad.Internal.Dependency
xmonadBusName :: BusName xmonadBusName :: BusName
xmonadBusName = busName_ "org.xmonad" 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 -- | Bind a callback to a signal match rule
addMatchCallback :: MatchRule -> ([Variant] -> IO ()) -> IO SignalHandler addMatchCallback :: MatchRule -> ([Variant] -> IO ()) -> IO SignalHandler
addMatchCallback rule cb = do addMatchCallback rule cb = do

View File

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

View File

@ -71,9 +71,9 @@ import XMonad.Internal.Shell
-- robust anyways, at the cost of being a bit slower. -- robust anyways, at the cost of being a bit slower.
data Feature a = Feature data Feature a = Feature
{ ftrAction :: Action a { ftrAction :: Action a
, ftrName :: String , ftrName :: String
, ftrWarning :: Warning , ftrWarning :: Warning
} }
| ConstFeature a | ConstFeature a
@ -83,8 +83,8 @@ data Action a = Parent a [Dependency]
| DBusBus (Client -> a) BusName (Maybe Client) [Dependency] | DBusBus (Client -> a) BusName (Maybe Client) [Dependency]
instance Functor Action where instance Functor Action where
fmap f (Parent a ds) = Parent (f a) ds fmap f (Parent a ds) = Parent (f a) ds
fmap f (Chain a b) = Chain (f . a) b fmap f (Chain a b) = Chain (f . a) b
fmap f (DBusEndpoint a c es ds) = DBusEndpoint (f . a) c es ds 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 fmap f (DBusBus a b c eps) = DBusBus (f . a) b c eps