REF rename Feature key

This commit is contained in:
Nathan Dwarshuis 2021-11-22 23:28:54 -05:00
parent b4380695d0
commit 6417a832c5
5 changed files with 17 additions and 17 deletions

View File

@ -281,14 +281,14 @@ rightPlugins sysClient sesClient = mapM evalFeature
getWireless :: BarFeature
getWireless = Feature
{ ftrAction = GenTree (Double wirelessCmd $ readInterface isWireless) []
{ ftrDepTree = GenTree (Double wirelessCmd $ readInterface isWireless) []
, ftrName = "wireless status indicator"
, ftrWarning = Default
}
getEthernet :: Maybe Client -> BarFeature
getEthernet client = Feature
{ ftrAction = DBusTree (Double (\i _ -> ethernetCmd i) (readInterface isEthernet)) client [dep] []
{ ftrDepTree = DBusTree (Double (\i _ -> ethernetCmd i) (readInterface isEthernet)) client [dep] []
, ftrName = "ethernet status indicator"
, ftrWarning = Default
}
@ -297,7 +297,7 @@ getEthernet client = Feature
getBattery :: BarFeature
getBattery = Feature
{ ftrAction = GenTree (Single batteryCmd) [IOTest hasBattery]
{ ftrDepTree = GenTree (Single batteryCmd) [IOTest hasBattery]
, ftrName = "battery level indicator"
, ftrWarning = Default
}
@ -306,7 +306,7 @@ type BarFeature = Feature CmdSpec
getVPN :: Maybe Client -> BarFeature
getVPN client = Feature
{ ftrAction = DBusTree (Single (const vpnCmd)) client [ep] [dp]
{ ftrDepTree = DBusTree (Single (const vpnCmd)) client [ep] [dp]
, ftrName = "VPN status indicator"
, ftrWarning = Default
}
@ -316,7 +316,7 @@ getVPN client = Feature
getBt :: Maybe Client -> BarFeature
getBt client = Feature
{ ftrAction = DBusTree (Single (const btCmd)) client [ep] []
{ ftrDepTree = DBusTree (Single (const btCmd)) client [ep] []
, ftrName = "bluetooth status indicator"
, ftrWarning = Default
}
@ -325,28 +325,28 @@ getBt client = Feature
getAlsa :: BarFeature
getAlsa = Feature
{ ftrAction = GenTree (Single alsaCmd) [Executable "alsactl"]
{ ftrDepTree = GenTree (Single alsaCmd) [Executable "alsactl"]
, ftrName = "volume level indicator"
, ftrWarning = Default
}
getBl :: Maybe Client -> BarFeature
getBl client = Feature
{ ftrAction = DBusTree (Single (const blCmd)) client [intelBacklightSignalDep] []
{ ftrDepTree = DBusTree (Single (const blCmd)) client [intelBacklightSignalDep] []
, ftrName = "Intel backlight indicator"
, ftrWarning = Default
}
getCk :: Maybe Client -> BarFeature
getCk client = Feature
{ ftrAction = DBusTree (Single (const ckCmd)) client [clevoKeyboardSignalDep] []
{ ftrDepTree = DBusTree (Single (const ckCmd)) client [clevoKeyboardSignalDep] []
, ftrName = "Clevo keyboard indicator"
, ftrWarning = Default
}
getSs :: Maybe Client -> BarFeature
getSs client = Feature
{ ftrAction = DBusTree (Single (const ssCmd)) client [ssSignalDep] []
{ ftrDepTree = DBusTree (Single (const ssCmd)) client [ssSignalDep] []
, ftrName = "screensaver indicator"
, ftrWarning = Default
}

View File

@ -86,7 +86,7 @@ listenDevices = do
runRemovableMon :: Maybe Client -> FeatureIO
runRemovableMon client = Feature
{ ftrAction = DBusTree (Single (const listenDevices)) client [addedDep, removedDep] []
{ ftrDepTree = DBusTree (Single (const listenDevices)) client [addedDep, removedDep] []
, ftrName = "removeable device monitor"
, ftrWarning = Default
}

View File

@ -90,7 +90,7 @@ matchSignal BrightnessConfig { bcPath = p, bcInterface = i } cb = do
brightnessExporter :: RealFrac b => [Dependency] -> BrightnessConfig a b
-> Maybe Client -> FeatureIO
brightnessExporter deps bc@BrightnessConfig { bcName = n } client = Feature
{ ftrAction = DBusTree (Single (exportBrightnessControls' bc)) client [Bus xmonadBusName] deps
{ ftrDepTree = DBusTree (Single (exportBrightnessControls' bc)) client [Bus xmonadBusName] deps
, ftrName = n ++ " exporter"
, ftrWarning = Default
}

View File

@ -95,7 +95,7 @@ bodyGetCurrentState _ = Nothing
exportScreensaver :: Maybe Client -> FeatureIO
exportScreensaver client = Feature
{ ftrAction = DBusTree (Single cmd) client [Bus xmonadBusName] [Executable ssExecutable]
{ ftrDepTree = DBusTree (Single cmd) client [Bus xmonadBusName] [Executable ssExecutable]
, ftrName = "screensaver interface"
, ftrWarning = Default
}

View File

@ -71,7 +71,7 @@ import XMonad.Internal.Shell
-- robust anyways, at the cost of being a bit slower.
data Feature a = Feature
{ ftrAction :: DepTree a
{ ftrDepTree :: DepTree a
, ftrName :: String
, ftrWarning :: Warning
}
@ -104,11 +104,11 @@ ioFeature Feature {..} =
-- HACK just doing a normal record update here will make GHC complain about
-- an 'insufficiently polymorphic record update' ...I guess because my
-- GADT isn't polymorphic enough (which is obviously BS)
Feature {ftrAction = liftIO <$> ftrAction, ..}
Feature {ftrDepTree = liftIO <$> ftrDepTree, ..}
featureDefault :: String -> [Dependency] -> a -> Feature a
featureDefault n ds x = Feature
{ ftrAction = GenTree (Single x) ds
{ ftrDepTree = GenTree (Single x) ds
, ftrName = n
, ftrWarning = Default
}
@ -123,7 +123,7 @@ featureExeArgs n cmd args =
featureEndpoint :: BusName -> ObjectPath -> InterfaceName -> MemberName
-> Maybe Client -> FeatureIO
featureEndpoint busname path iface mem client = Feature
{ ftrAction = DBusTree (Single cmd) client deps []
{ ftrDepTree = DBusTree (Single cmd) client deps []
, ftrName = "screensaver toggle"
, ftrWarning = Default
}
@ -173,7 +173,7 @@ evalAction (Double a b) = fmap a <$> b
evalFeature :: Feature a -> IO (MaybeAction a)
evalFeature (ConstFeature x) = return $ Just x
evalFeature Feature
{ ftrAction = a
{ ftrDepTree = a
, ftrName = n
, ftrWarning = w
} = do