Updated documentation of all prompts in XMonad.Prompt

This commit is contained in:
Andrea Rossato
2007-11-21 14:27:15 +00:00
parent 0388e0ae47
commit 2a443363b8
8 changed files with 36 additions and 42 deletions

View File

@@ -3,7 +3,7 @@
-- Module : XMonad.Prompt.Directory
-- Copyright : (C) 2007 Andrea Rossato, David Roundy
-- License : BSD3
--
--
-- Maintainer : droundy@darcs.net
-- Stability : unstable
-- Portability : unportable

View File

@@ -3,7 +3,7 @@
-- Module : XMonad.Prompt.Layout
-- Copyright : (C) 2007 Andrea Rossato, David Roundy
-- License : BSD3
--
--
-- Maintainer : droundy@darcs.net
-- Stability : unstable
-- Portability : unportable
@@ -27,13 +27,16 @@ import XMonad.StackSet ( workspaces, layout )
import XMonad.Layout.LayoutCombinators ( JumpToLayout(..) )
-- $usage
-- You can use this module with the following in your Config.hs file:
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Prompt
-- > import XMonad.Prompt.Layout
--
-- > , ((modMask x .|. shiftMask, xK_m ), layoutPrompt defaultXPConfig)
--
-- For detailed instruction on editing the key binding see
-- "XMonad.Doc.Extending#Editing_key_bindings".
--
-- WARNING: This prompt won't display all possible layouts, because the
-- code to enable this was rejected from xmonad core. It only displays
-- layouts that are actually in use. Also, you can only select layouts if

View File

@@ -40,7 +40,7 @@ import Data.List
import Data.Maybe
-- $usage
-- 1. In Config.hs add:
-- 1. In your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Prompt
-- > import XMonad.Prompt.Man
@@ -48,10 +48,9 @@ import Data.Maybe
-- 2. In your keybindings add something like:
--
-- > , ((modMask x, xK_F1), manPrompt defaultXPConfig)
-- %import XMonad.Prompt
-- %import XMonad.Prompt.Man
-- %keybind , ((modMask x, xK_F1), manPrompt defaultXPConfig)
--
-- For detailed instruction on editing the key binding see
-- "XMonad.Doc.Extending#Editing_key_bindings".
data Man = Man

View File

@@ -32,8 +32,7 @@ import XMonad hiding (config)
import XMonad.Prompt
-- $usage
--
-- 1. In Config.hs add:
-- 1. In your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Prompt
-- > import XMonad.Prompt.Shell
@@ -42,10 +41,8 @@ import XMonad.Prompt
--
-- > , ((modMask x .|. controlMask, xK_x), shellPrompt defaultXPConfig)
--
-- %import XMonad.Prompt
-- %import XMonad.Prompt.Shell
-- %keybind , ((modMask x .|. controlMask, xK_x), shellPrompt defaultXPConfig)
-- For detailed instruction on editing the key binding see
-- "XMonad.Doc.Extending#Editing_key_bindings".
data Shell = Shell

View File

@@ -30,7 +30,7 @@ import Data.List
import Data.Maybe
-- $usage
-- 1. In Config.hs add:
-- 1. In your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Prompt
-- > import XMonad.Prompt.Ssh
@@ -39,10 +39,8 @@ import Data.Maybe
--
-- > , ((modMask x .|. controlMask, xK_s), sshPrompt defaultXPConfig)
--
-- %import XMonad.Prompt
-- %import XMonad.Prompt.Ssh
-- %keybind , ((modMask x .|. controlMask, xK_s), sshPrompt defaultXPConfig)
-- For detailed instruction on editing the key binding see
-- "XMonad.Doc.Extending#Editing_key_bindings".
data Ssh = Ssh

View File

@@ -17,7 +17,7 @@
module XMonad.Prompt.Window
(
-- * Usage
-- $usage
-- $usage
windowPromptGoto,
windowPromptBring
) where
@@ -36,7 +36,7 @@ import XMonad.Actions.WindowBringer
-- That is to say, it pops up a prompt with window names, in case you forgot
-- where you left your XChat.
--
-- Place in your Config.hs:
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Prompt
-- > import XMonad.Prompt.Window
@@ -45,15 +45,12 @@ import XMonad.Actions.WindowBringer
--
-- > , ((modMask x .|. shiftMask, xK_g ), windowPromptGoto defaultXPConfig)
-- > , ((modMask x .|. shiftMask, xK_b ), windowPromptBring defaultXPConfig)
-- %import XMonad.Prompt
-- %import XMonad.Prompt.Window
-- %keybind , ((modMask x .|. shiftMask, xK_g ), windowPromptGoto defaultXPConfig)
-- %keybind , ((modMask x .|. shiftMask, xK_b ), windowPromptBring defaultXPConfig)
--
-- For detailed instruction on editing the key binding see
-- "XMonad.Doc.Extending#Editing_key_bindings".
data WindowPrompt = Goto | Bring
instance XPrompt WindowPrompt where
instance XPrompt WindowPrompt where
showXPrompt Goto = "Go to window: "
showXPrompt Bring = "Bring me here: "
@@ -66,14 +63,14 @@ windowPromptBring c = doPrompt Bring c
doPrompt :: WindowPrompt -> XPConfig -> X ()
doPrompt t c = do
a <- case t of
Goto -> return . gotoAction =<< windowMapWith (W.tag . fst)
Goto -> return . gotoAction =<< windowMapWith (W.tag . fst)
Bring -> return . bringAction =<< windowMapWith snd
wm <- windowMapWith id
mkXPrompt t c (compList wm) a
where
winAction a m = flip whenJust (windows . a) . flip M.lookup m . unescape
winAction a m = flip whenJust (windows . a) . flip M.lookup m . unescape
gotoAction = winAction W.greedyView
bringAction = winAction bringWindow
bringWindow w ws = W.shiftWin (W.tag . W.workspace . W.current $ ws) w ws

View File

@@ -3,7 +3,7 @@
-- Module : XMonad.Prompt.Workspace
-- Copyright : (C) 2007 Andrea Rossato, David Roundy
-- License : BSD3
--
--
-- Maintainer : droundy@darcs.net
-- Stability : unstable
-- Portability : unportable
@@ -25,12 +25,15 @@ import XMonad.Prompt
import XMonad.StackSet ( workspaces, tag )
-- $usage
-- You can use this module with the following in your Config.hs file:
--
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Prompt
-- > import XMonad.Prompt.Workspace
--
-- > , ((modMask x .|. shiftMask, xK_m ), workspacePrompt defaultXPConfig (windows . W.shift))
--
-- For detailed instruction on editing the key binding see
-- "XMonad.Doc.Extending#Editing_key_bindings".
data Wor = Wor String

View File

@@ -3,7 +3,7 @@
-- Module : XMonad.Prompt.XMonad
-- Copyright : (C) 2007 Andrea Rossato
-- License : BSD3
--
--
-- Maintainer : andrea.rossato@unibz.it
-- Stability : unstable
-- Portability : unportable
@@ -24,8 +24,7 @@ import XMonad.Prompt
import XMonad.Actions.Commands (defaultCommands, runCommand')
-- $usage
--
-- in Config.hs add:
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
--
-- > import XMonad.Prompt
-- > import XMonad.Prompt.XMonad
@@ -34,10 +33,8 @@ import XMonad.Actions.Commands (defaultCommands, runCommand')
--
-- > , ((modMask x .|. controlMask, xK_x), xmonadPrompt defaultXPConfig)
--
-- %import XMonad.Prompt
-- %import XMonad.Prompt.XMonad
-- %keybind , ((modMask x .|. controlMask, xK_x), xmonadPrompt defaultXPConfig)
-- For detailed instruction on editing the key binding see
-- "XMonad.Doc.Extending#Editing_key_bindings".
data XMonad = XMonad
@@ -49,6 +46,6 @@ xmonadPrompt c = do
cmds <- defaultCommands
mkXPrompt XMonad c (mkComplFunFromList (map fst cmds)) runCommand'
-- xmonad prompt with custom command list
-- | An xmonad prompt with a custom command list
xmonadPromptC :: [(String, X ())] -> XPConfig -> X ()
xmonadPromptC commands c = mkXPrompt XMonad c (mkComplFunFromList (map fst commands)) runCommand'