REF fix action key name

This commit is contained in:
Nathan Dwarshuis 2021-11-21 23:56:27 -05:00
parent 866d2cbb75
commit c03f1938a1
5 changed files with 17 additions and 17 deletions

View File

@ -283,7 +283,7 @@ rightPlugins sysClient sesClient = mapM evalFeature
getWireless :: BarFeature getWireless :: BarFeature
getWireless = Feature getWireless = Feature
{ ftrMaybeAction = Chain wirelessCmd $ readInterface isWireless { ftrAction = Chain wirelessCmd $ readInterface isWireless
, ftrName = "wireless status indicator" , ftrName = "wireless status indicator"
, ftrWarning = Default , ftrWarning = Default
} }
@ -291,7 +291,7 @@ getWireless = Feature
-- TODO this needs a dbus interface -- TODO this needs a dbus interface
getEthernet :: BarFeature getEthernet :: BarFeature
getEthernet = Feature getEthernet = Feature
{ ftrMaybeAction = Chain ethernetCmd (readInterface isEthernet) { ftrAction = Chain ethernetCmd (readInterface isEthernet)
, ftrName = "ethernet status indicator" , ftrName = "ethernet status indicator"
, ftrWarning = Default , ftrWarning = Default
} }
@ -303,7 +303,7 @@ getEthernet = Feature
getBattery :: BarFeature getBattery :: BarFeature
getBattery = Feature getBattery = Feature
{ ftrMaybeAction = Parent batteryCmd [IOTest hasBattery] { ftrAction = Parent batteryCmd [IOTest hasBattery]
, ftrName = "battery level indicator" , ftrName = "battery level indicator"
, ftrWarning = Default , ftrWarning = Default
} }
@ -312,7 +312,7 @@ type BarFeature = Feature CmdSpec
getVPN :: Maybe Client -> BarFeature getVPN :: Maybe Client -> BarFeature
getVPN client = Feature getVPN client = Feature
{ ftrMaybeAction = DBusEndpoint_ (const vpnCmd) client [ep] [dp] { ftrAction = DBusEndpoint_ (const vpnCmd) client [ep] [dp]
, ftrName = "VPN status indicator" , ftrName = "VPN status indicator"
, ftrWarning = Default , ftrWarning = Default
} }
@ -322,7 +322,7 @@ getVPN client = Feature
getBt :: Maybe Client -> BarFeature getBt :: Maybe Client -> BarFeature
getBt client = Feature getBt client = Feature
{ ftrMaybeAction = DBusEndpoint_ (const btCmd) client [ep] [] { ftrAction = DBusEndpoint_ (const btCmd) client [ep] []
, ftrName = "bluetooth status indicator" , ftrName = "bluetooth status indicator"
, ftrWarning = Default , ftrWarning = Default
} }
@ -331,28 +331,28 @@ getBt client = Feature
getAlsa :: BarFeature getAlsa :: BarFeature
getAlsa = Feature getAlsa = Feature
{ ftrMaybeAction = Parent alsaCmd [Executable "alsactl"] { ftrAction = Parent 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
{ ftrMaybeAction = DBusEndpoint_ (const blCmd) client [intelBacklightSignalDep] [] { ftrAction = DBusEndpoint_ (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
{ ftrMaybeAction = DBusEndpoint_ (const ckCmd) client [clevoKeyboardSignalDep] [] { ftrAction = DBusEndpoint_ (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
{ ftrMaybeAction = DBusEndpoint_ (const ssCmd) client [ssSignalDep] [] { ftrAction = DBusEndpoint_ (const ssCmd) client [ssSignalDep] []
, ftrName = "screensaver indicator" , ftrName = "screensaver indicator"
, ftrWarning = Default , ftrWarning = Default
} }

View File

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

View File

@ -91,7 +91,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
{ ftrMaybeAction = DBusBus_ (exportBrightnessControls' bc) xmonadBusName client deps { ftrAction = DBusBus_ (exportBrightnessControls' bc) xmonadBusName client 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
{ ftrMaybeAction = DBusBus_ cmd xmonadBusName client [Executable ssExecutable] { ftrAction = DBusBus_ cmd xmonadBusName client [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
{ ftrMaybeAction :: Action a { ftrAction :: Action a
, ftrName :: String , ftrName :: String
, ftrWarning :: Warning , ftrWarning :: Warning
} }
@ -102,11 +102,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 {ftrMaybeAction = liftIO <$> ftrMaybeAction, ..} Feature {ftrAction = liftIO <$> ftrAction, ..}
featureDefault :: String -> [Dependency] -> a -> Feature a featureDefault :: String -> [Dependency] -> a -> Feature a
featureDefault n ds x = Feature featureDefault n ds x = Feature
{ ftrMaybeAction = Parent x ds { ftrAction = Parent x ds
, ftrName = n , ftrName = n
, ftrWarning = Default , ftrWarning = Default
} }
@ -121,7 +121,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
{ ftrMaybeAction = DBusEndpoint_ cmd client deps [] { ftrAction = DBusEndpoint_ cmd client deps []
, ftrName = "screensaver toggle" , ftrName = "screensaver toggle"
, ftrWarning = Default , ftrWarning = Default
} }
@ -169,7 +169,7 @@ evalAction (DBusBus_ action busname (Just client) deps) = do
evalFeature :: Feature a -> IO (MaybeAction a) evalFeature :: Feature a -> IO (MaybeAction a)
evalFeature (ConstFeature x) = return $ Right x evalFeature (ConstFeature x) = return $ Right x
evalFeature Feature evalFeature Feature
{ ftrMaybeAction = a { ftrAction = a
, ftrName = n , ftrName = n
, ftrWarning = w , ftrWarning = w
} = do } = do