mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.H.Modal: Update documentation
Now that we use a slightly different setup, as well as EZConfig support, rewrite the introduction to the module a little.
This commit is contained in:
parent
fe337dc6b0
commit
8ddc1f48e2
@ -84,6 +84,8 @@ import XMonad.Util.Parser ( runParser )
|
|||||||
-- >
|
-- >
|
||||||
-- > import XMonad
|
-- > import XMonad
|
||||||
-- > import XMonad.Hooks.Modal
|
-- > import XMonad.Hooks.Modal
|
||||||
|
-- > import XMonad.Util.EZConfig
|
||||||
|
-- > import qualified Data.Map as M
|
||||||
-- >
|
-- >
|
||||||
-- > main :: IO ()
|
-- > main :: IO ()
|
||||||
-- > main =
|
-- > main =
|
||||||
@ -93,18 +95,41 @@ import XMonad.Util.Parser ( runParser )
|
|||||||
-- > `additionalKeysP` [ ("M-S-n", setMode noModModeLabel)
|
-- > `additionalKeysP` [ ("M-S-n", setMode noModModeLabel)
|
||||||
-- > , ("M-S-r", setMode floatModeLabel)
|
-- > , ("M-S-r", setMode floatModeLabel)
|
||||||
-- > , ("M-S-z", setMode overlayedFloatModeLabel)
|
-- > , ("M-S-z", setMode overlayedFloatModeLabel)
|
||||||
|
-- > , ("M-S-h", setMode "Hello")
|
||||||
-- > ]
|
-- > ]
|
||||||
-- >
|
-- >
|
||||||
-- > sayHelloMode :: Mode
|
-- > sayHelloMode :: Mode
|
||||||
-- > sayHelloMode = mode "Hello"
|
-- > sayHelloMode = mode "Hello" $ mkKeysEz
|
||||||
-- > $ const (M.fromList [((noModMask, xK_h), xmessage "Hello World! ")])
|
-- > [ ("h", xmessage "Hello, World!")
|
||||||
|
-- > , ("M-g", xmessage "Goodbye, World!")
|
||||||
|
-- > ]
|
||||||
--
|
--
|
||||||
-- A 'Mode' has a label describing its purpose and keybindings (in form
|
-- Alternatively, one could have defined @sayHelloMode@ as
|
||||||
-- of @XConfig Layout -> M.Map (ButtonMask, KeySym) (X ())@). The label
|
--
|
||||||
-- of the active mode can be logged with 'logMode' to be displayed in a
|
-- > sayHelloMode :: Mode
|
||||||
-- status bar, for example (For more information check
|
-- > sayHelloMode = mode "Hello" $ \cfg ->
|
||||||
-- "XMonad.Util.Loggers"). Some examples are included in
|
-- > M.fromList [ ((noModMask, xK_h), xmessage "Hello, World!")
|
||||||
-- [the provided modes](#g:ProvidedModes).
|
-- > , ((modMask cfg, xK_g), xmessage "Goodbye, World!")
|
||||||
|
-- > ]
|
||||||
|
--
|
||||||
|
-- In short, a 'Mode' has a label describing its purpose, as well as
|
||||||
|
-- attached keybindings. These are of the form
|
||||||
|
--
|
||||||
|
-- - @[(String, X ())]@, or
|
||||||
|
--
|
||||||
|
-- - @XConfig Layout -> M.Map (ButtonMask, KeySym) (X ())@).
|
||||||
|
--
|
||||||
|
-- The former—accessible via 'mkKeysEz'—is how specifying keys work with
|
||||||
|
-- "XMonad.Util.EZConfig", while the latter is more geared towards how
|
||||||
|
-- defining keys works by default in xmonad. Note that, by default,
|
||||||
|
-- modes are exited with the Escape key. If one wishes to customise
|
||||||
|
-- this, the 'modeWithExit' function should be used instead of 'mode'
|
||||||
|
-- when defining a new mode.
|
||||||
|
--
|
||||||
|
-- The label of the active mode can be logged with 'logMode' to be
|
||||||
|
-- displayed in a status bar, for example (For more information check
|
||||||
|
-- "XMonad.Util.Loggers"). Some examples are included in [the provided
|
||||||
|
-- modes](#g:ProvidedModes).
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user