aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Prompt.hs
diff options
context:
space:
mode:
authorDaniel Wagner <daniel@wagner-home.com>2013-05-28 03:39:09 +0200
committerDaniel Wagner <daniel@wagner-home.com>2013-05-28 03:39:09 +0200
commit6769de07f7e06ddf6eea728bd7072ebfe6eff017 (patch)
treef234bf0cac01538fbc1acab1a668ac61b9ab8074 /XMonad/Prompt.hs
parentfe066e8e9ca5326dd146630a6d729fae51af12cf (diff)
downloadXMonadContrib-6769de07f7e06ddf6eea728bd7072ebfe6eff017.tar.gz
XMonadContrib-6769de07f7e06ddf6eea728bd7072ebfe6eff017.tar.xz
XMonadContrib-6769de07f7e06ddf6eea728bd7072ebfe6eff017.zip
use Data.Default wherever possible, and deprecate the things it replaces
Ignore-this: 898458b1d2868a70dfb09faf473dc7aa darcs-hash:20130528013909-76d51-863278165b6f149c47b08b31b34e85ddcab19f1f.gz
Diffstat (limited to 'XMonad/Prompt.hs')
-rw-r--r--XMonad/Prompt.hs17
1 files changed, 10 insertions, 7 deletions
diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs
index e9613db..0a032c4 100644
--- a/XMonad/Prompt.hs
+++ b/XMonad/Prompt.hs
@@ -19,6 +19,7 @@ module XMonad.Prompt
mkXPrompt
, mkXPromptWithReturn
, mkXPromptWithModes
+ , def
, amberXPConfig
, defaultXPConfig
, greenXPConfig
@@ -230,7 +231,8 @@ data XPPosition = Top
amberXPConfig, defaultXPConfig, greenXPConfig :: XPConfig
-defaultXPConfig =
+instance Default XPConfig where
+ def =
XPC { font = "-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*"
, bgColor = "grey22"
, fgColor = "grey80"
@@ -252,8 +254,10 @@ defaultXPConfig =
, searchPredicate = isPrefixOf
, alwaysHighlight = False
}
-greenXPConfig = defaultXPConfig { fgColor = "green", bgColor = "black", promptBorderWidth = 0 }
-amberXPConfig = defaultXPConfig { fgColor = "#ca8f2d", bgColor = "black", fgHLight = "#eaaf4c" }
+{-# DEPRECATED defaultXPConfig "Use def (from Data.Default, and re-exported from XMonad.Prompt) instead." #-}
+defaultXPConfig = def
+greenXPConfig = def { fgColor = "green", bgColor = "black", promptBorderWidth = 0 }
+amberXPConfig = def { fgColor = "#ca8f2d", bgColor = "black", fgHLight = "#eaaf4c" }
initState :: Display -> Window -> Window -> Rectangle -> XPOperationMode
-> GC -> XMonadFont -> [String] -> XPConfig -> KeyMask -> XPState
@@ -377,8 +381,7 @@ mkXPromptWithReturn t conf compl action = do
--
-- * a prompt type, instance of the 'XPrompt' class.
--
--- * a prompt configuration ('defaultXPConfig' can be used as a
--- starting point)
+-- * a prompt configuration ('def' can be used as a starting point)
--
-- * a completion function ('mkComplFunFromList' can be used to
-- create a completions function given a list of possible completions)
@@ -1192,10 +1195,10 @@ historyNextMatching hm@(HistoryMatches ref) next = do
-- > ..
-- > ((modMask,xK_p), shellPrompt . myPrompt =<< initMatches)
-- > ..
--- > myPrompt ref = defaultPrompt
+-- > myPrompt ref = def
-- > { promptKeymap = M.union [((0,xK_Up), historyUpMatching ref)
-- > ,((0,xK_Down), historyDownMatching ref)]
--- > (promptKeymap defaultPrompt)
+-- > (promptKeymap def)
-- > , .. }
--
historyUpMatching, historyDownMatching :: HistoryMatches -> XP ()