From 9b71bcbc56caa60de56d9b31975b10eb2f55555c Mon Sep 17 00:00:00 2001 From: "nicolas.pouillard" Date: Wed, 9 Jan 2008 22:39:16 +0100 Subject: prompt: Allow to provide a default text in the prompt config. darcs-hash:20080109213916-94725-806649257a0bc1b5d7b9ac423d82e03cd240cddb.gz --- XMonad/Prompt.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index 3459db7..0c83637 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -96,6 +96,7 @@ data XPConfig = , position :: XPPosition -- ^ Position: 'Top' or 'Bottom' , height :: Dimension -- ^ Window height , historySize :: Int -- ^ The number of history entries to be saved + , defaultText :: String -- ^ The text by default in the prompt line } deriving (Show, Read) data XPType = forall p . XPrompt p => XPT p @@ -135,6 +136,7 @@ defaultXPConfig = , position = Bottom , height = 18 , historySize = 256 + , defaultText = [] } type ComplFunction = String -> IO [String] @@ -142,7 +144,7 @@ type ComplFunction = String -> IO [String] initState :: XPrompt p => Display -> Window -> Window -> Rectangle -> ComplFunction -> GC -> XMonadFont -> p -> [History] -> XPConfig -> XPState initState d rw w s compl gc fonts pt h c = - XPS d rw w s Nothing Nothing compl gc fonts (XPT pt) "" 0 h c + XPS d rw w s Nothing Nothing compl gc fonts (XPT pt) (defaultText c) 0 h c -- | Same as 'mkXPrompt', except that the action function can have -- type @String -> X a@, for any @a@, and the final action returned -- cgit v1.2.3