diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..fa76634 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: + - liskin diff --git a/CHANGES.md b/CHANGES.md index 8facb97..4af984a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -41,6 +41,9 @@ Instead, the manpage source is regenerated and manpage rebuilt automatically in CI. + * Added the `extensibleConf` field to `XConfig` which makes it easier for + contrib modules to have composable configuration (custom hooks, …). + ## 0.15 (September 30, 2018) * Reimplement `sendMessage` to deal properly with windowset changes made diff --git a/src/XMonad/Config.hs b/src/XMonad/Config.hs index 5d176da..cd655d5 100644 --- a/src/XMonad/Config.hs +++ b/src/XMonad/Config.hs @@ -277,6 +277,7 @@ instance (a ~ Choose Tall (Choose (Mirror Tall) Full)) => Default (XConfig a) wh , XMonad.handleExtraArgs = \ xs theConf -> case xs of [] -> return theConf _ -> fail ("unrecognized flags:" ++ show xs) + , XMonad.extensibleConf = M.empty } -- | The default set of configuration values itself diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs index 435e84b..3e3c621 100644 --- a/src/XMonad/Core.hs +++ b/src/XMonad/Core.hs @@ -23,7 +23,7 @@ module XMonad.Core ( XConf(..), XConfig(..), LayoutClass(..), Layout(..), readsLayout, Typeable, Message, SomeMessage(..), fromMessage, LayoutMessages(..), - StateExtension(..), ExtensionClass(..), + StateExtension(..), ExtensionClass(..), ConfExtension(..), runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers, uninstallSignalHandlers, withDisplay, withWindowSet, isRoot, runOnWorkspaces, getAtom, spawn, spawnPID, xfork, recompile, trace, whenJust, whenX, @@ -122,6 +122,11 @@ data XConfig l = XConfig , rootMask :: !EventMask -- ^ The root events that xmonad is interested in , handleExtraArgs :: !([String] -> XConfig Layout -> IO (XConfig Layout)) -- ^ Modify the configuration, complain about extra arguments etc. with arguments that are not handled by default + , extensibleConf :: !(M.Map TypeRep ConfExtension) + -- ^ Stores custom config information. + -- + -- The module "XMonad.Util.ExtensibleConf" in xmonad-contrib + -- provides additional information and a simple interface for using this. } @@ -383,7 +388,7 @@ data LayoutMessages = Hide -- ^ sent when a layout becomes non-visi instance Message LayoutMessages -- --------------------------------------------------------------------- --- Extensible state +-- Extensible state/config -- -- | Every module must make the data it wants to store @@ -410,6 +415,9 @@ data StateExtension = | forall a. (Read a, Show a, ExtensionClass a) => PersistentExtension a -- ^ Persistent extension +-- | Existential type to store a config extension. +data ConfExtension = forall a. Typeable a => ConfExtension a + -- --------------------------------------------------------------------- -- | General utilities --