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

View File

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

View File

@ -90,7 +90,7 @@ matchSignal BrightnessConfig { bcPath = p, bcInterface = i } cb = do
brightnessExporter :: RealFrac b => [Dependency] -> BrightnessConfig a b brightnessExporter :: RealFrac b => [Dependency] -> BrightnessConfig a b
-> Maybe Client -> FeatureIO -> Maybe Client -> FeatureIO
brightnessExporter deps bc@BrightnessConfig { bcName = n } client = Feature 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" , ftrName = n ++ " exporter"
, ftrWarning = Default , ftrWarning = Default
} }

View File

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

View File

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