Merge pull request #453 from slotThe/default->def

Remove last occurences of non Data.Default defaults
This commit is contained in:
Tomáš Janoušek
2021-01-28 21:48:25 +01:00
committed by GitHub
6 changed files with 38 additions and 37 deletions

View File

@@ -94,12 +94,12 @@ grab" and let the C-c C-u be sent to the application.
The simplest way to enable this is to use 'useDefaultPrefixArgument' The simplest way to enable this is to use 'useDefaultPrefixArgument'
> xmonad $ useDefaultPrefixArgument $ defaultConfig { .. } > xmonad $ useDefaultPrefixArgument $ def { .. }
The default prefix argument is C-u. If you want to customize the The default prefix argument is C-u. If you want to customize the
prefix argument, use the following: prefix argument, use the following:
> xmonad $ usePrefixArgument prefixKey $ defaultConfig { .. } > xmonad $ usePrefixArgument prefixKey $ def { .. }
where 'prefixKey' is a function which takes 'XConfig' as an argument where 'prefixKey' is a function which takes 'XConfig' as an argument
in case you wish to extract the 'modMask'. An example in case you wish to extract the 'modMask'. An example

View File

@@ -40,6 +40,7 @@ module XMonad.Actions.TreeSelect
, TSConfig(..) , TSConfig(..)
, tsDefaultConfig , tsDefaultConfig
, def
-- * Navigation -- * Navigation
-- $navigation -- $navigation
@@ -113,10 +114,10 @@ import Graphics.X11.Xrender
-- --
-- Optionally, if you add 'workspaceHistoryHook' to your 'logHook' you can use the \'o\' and \'i\' keys to select from previously-visited workspaces -- Optionally, if you add 'workspaceHistoryHook' to your 'logHook' you can use the \'o\' and \'i\' keys to select from previously-visited workspaces
-- --
-- > xmonad $ defaultConfig { ... -- > xmonad $ def { ...
-- > , workspaces = toWorkspaces myWorkspaces -- > , workspaces = toWorkspaces myWorkspaces
-- > , logHook = workspaceHistoryHook -- > , logHook = workspaceHistoryHook
-- > } -- > }
-- --
-- After that you still need to bind buttons to 'treeselectWorkspace' to start selecting a workspaces and moving windows -- After that you still need to bind buttons to 'treeselectWorkspace' to start selecting a workspaces and moving windows
-- --
@@ -131,22 +132,22 @@ import Graphics.X11.Xrender
-- $config -- $config
-- The selection menu is very configurable, you can change the font, all colors and the sizes of the boxes. -- The selection menu is very configurable, you can change the font, all colors and the sizes of the boxes.
-- --
-- The default config defined as 'tsDefaultConfig' -- The default config defined as 'def'
-- --
-- > tsDefaultConfig = TSConfig { ts_hidechildren = True -- > def = TSConfig { ts_hidechildren = True
-- > , ts_background = 0xc0c0c0c0 -- > , ts_background = 0xc0c0c0c0
-- > , ts_font = "xft:Sans-16" -- > , ts_font = "xft:Sans-16"
-- > , ts_node = (0xff000000, 0xff50d0db) -- > , ts_node = (0xff000000, 0xff50d0db)
-- > , ts_nodealt = (0xff000000, 0xff10b8d6) -- > , ts_nodealt = (0xff000000, 0xff10b8d6)
-- > , ts_highlight = (0xffffffff, 0xffff0000) -- > , ts_highlight = (0xffffffff, 0xffff0000)
-- > , ts_extra = 0xff000000 -- > , ts_extra = 0xff000000
-- > , ts_node_width = 200 -- > , ts_node_width = 200
-- > , ts_node_height = 30 -- > , ts_node_height = 30
-- > , ts_originX = 0 -- > , ts_originX = 0
-- > , ts_originY = 0 -- > , ts_originY = 0
-- > , ts_indent = 80 -- > , ts_indent = 80
-- > , ts_navigate = defaultNavigation -- > , ts_navigate = defaultNavigation
-- > } -- > }
-- $pixel -- $pixel
-- --
@@ -258,6 +259,7 @@ defaultNavigation = M.fromList
-- Using nice alternating blue nodes -- Using nice alternating blue nodes
tsDefaultConfig :: TSConfig a tsDefaultConfig :: TSConfig a
tsDefaultConfig = def tsDefaultConfig = def
{-# DEPRECATED tsDefaultConfig "Use def (from Data.Default, and re-exported by XMonad.Actions.TreeSelect) instead." #-}
-- | Tree Node With a name and extra text -- | Tree Node With a name and extra text
data TSNode a = TSNode { tsn_name :: String data TSNode a = TSNode { tsn_name :: String

View File

@@ -533,7 +533,7 @@ instance UrgencyHook StdoutUrgencyHook where
-- --
-- Useful for scratchpad workspaces perhaps: -- Useful for scratchpad workspaces perhaps:
-- --
-- > main = xmonad (withUrgencyHook (filterUrgencyHook ["NSP", "SP"]) defaultConfig) -- > main = xmonad (withUrgencyHook (filterUrgencyHook ["NSP", "SP"]) def)
filterUrgencyHook :: [WorkspaceId] -> Window -> X () filterUrgencyHook :: [WorkspaceId] -> Window -> X ()
filterUrgencyHook skips w = do filterUrgencyHook skips w = do
ws <- gets windowset ws <- gets windowset

View File

@@ -53,7 +53,7 @@ import Data.Maybe
-- --
-- > myWorkspaces = ["1:main","2:misc","3","4"] -- > myWorkspaces = ["1:main","2:misc","3","4"]
-- > ... -- > ...
-- > main = xmonad $ defaultConfig { -- > main = xmonad $ def {
-- > logHook = wallpaperSetter defWallpaperConf { -- > logHook = wallpaperSetter defWallpaperConf {
-- > wallpapers = defWPNames myWorkspaces -- > wallpapers = defWPNames myWorkspaces
-- > <> WallpaperList [("1:main",WallpaperDir "1")] -- > <> WallpaperList [("1:main",WallpaperDir "1")]

View File

@@ -72,7 +72,7 @@ import Control.Arrow (second)
-- --
-- > main = xmonad -- > main = xmonad
-- > $ fullscreenSupport -- > $ fullscreenSupport
-- > $ defaultConfig { ... } -- > $ def { ... }
fullscreenSupport :: LayoutClass l Window => fullscreenSupport :: LayoutClass l Window =>
XConfig l -> XConfig (ModifiedLayout FullscreenFull l) XConfig l -> XConfig (ModifiedLayout FullscreenFull l)
fullscreenSupport c = c { fullscreenSupport c = c {

View File

@@ -3,7 +3,7 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : XMonad.Util.SpawnNamedPipe -- Module : XMonad.Util.SpawnNamedPipe
-- Copyright : (c) Christian Wills 2014 -- Copyright : (c) Christian Wills 2014
-- License : BSD3-style (see LICENSE) -- License : BSD3-style (see LICENSE)
-- --
-- Maintainer : cwills.dev@gmail.com -- Maintainer : cwills.dev@gmail.com
@@ -35,10 +35,10 @@ import qualified Data.Map as Map
-- --
-- > import XMonad.Util.SpawnNamedPipe -- > import XMonad.Util.SpawnNamedPipe
-- > import Data.Maybe -- > import Data.Maybe
-- > -- >
-- > -- StartupHook -- > -- StartupHook
-- > startupHook' = spawnNamedPipe "dzen2" "dzenPipe" -- > startupHook' = spawnNamedPipe "dzen2" "dzenPipe"
-- > -- >
-- > -- LogHook -- > -- LogHook
-- > logHook' = do -- > logHook' = do
-- > mh <- getNamedPipeHandle "dzenPipe" -- > mh <- getNamedPipeHandle "dzenPipe"
@@ -46,31 +46,30 @@ import qualified Data.Map as Map
-- > ppOutput = maybe (\s -> return ()) (hPutStrLn) mh} -- > ppOutput = maybe (\s -> return ()) (hPutStrLn) mh}
-- > -- >
-- > -- Main -- > -- Main
-- > main = xmonad $ defaultConfig { -- > main = xmonad $ def { startupHook = startupHook'
-- > startupHook = startupHook' -- > , logHook = logHook'}
-- > , logHook = logHook'}
-- --
data NamedPipes = NamedPipes { pipeMap :: Map.Map String Handle } data NamedPipes = NamedPipes { pipeMap :: Map.Map String Handle }
deriving (Show, Typeable) deriving (Show, Typeable)
instance ExtensionClass NamedPipes where instance ExtensionClass NamedPipes where
initialValue = NamedPipes Map.empty initialValue = NamedPipes Map.empty
-- | When 'spawnNamedPipe' is executed with a command "String" and a name -- | When 'spawnNamedPipe' is executed with a command "String" and a name
-- "String" respectively. The command string is spawned with 'spawnPipe' (as -- "String" respectively. The command string is spawned with 'spawnPipe' (as
-- long as the name chosen hasn't been used already) and the "Handle" returned -- long as the name chosen hasn't been used already) and the "Handle" returned
-- is saved in Xmonad's state associated with the name "String". -- is saved in Xmonad's state associated with the name "String".
spawnNamedPipe :: String -> String -> X () spawnNamedPipe :: String -> String -> X ()
spawnNamedPipe cmd name = do spawnNamedPipe cmd name = do
b <- XS.gets (Map.member name . pipeMap) b <- XS.gets (Map.member name . pipeMap)
unless b $ do unless b $ do
h <- spawnPipe cmd h <- spawnPipe cmd
XS.modify (NamedPipes . Map.insert name h . pipeMap) XS.modify (NamedPipes . Map.insert name h . pipeMap)
-- | Attempts to retrieve a "Handle" to a pipe previously stored in Xmonad's -- | Attempts to retrieve a "Handle" to a pipe previously stored in Xmonad's
-- state associated with the given string via a call to 'spawnNamedPipe'. If the -- state associated with the given string via a call to 'spawnNamedPipe'. If the
-- given string doesn't exist in the map stored in Xmonad's state Nothing is -- given string doesn't exist in the map stored in Xmonad's state Nothing is
-- returned. -- returned.
getNamedPipe :: String -> X (Maybe Handle) getNamedPipe :: String -> X (Maybe Handle)
getNamedPipe name = XS.gets (Map.lookup name . pipeMap) getNamedPipe name = XS.gets (Map.lookup name . pipeMap)