|
XMonad.Prompt | Portability | unportable | Stability | unstable | Maintainer | Spencer Janssen <spencerjanssen@gmail.com> |
|
|
|
|
|
Description |
A module for writing graphical prompts for XMonad
|
|
Synopsis |
|
|
|
|
Usage
|
|
For usage examples see XMonad.Prompt.Shell,
XMonad.Prompt.XMonad or XMonad.Prompt.Ssh
TODO:
- scrolling the completions that don't fit in the window (?)
|
|
|
Creates a prompt given:
- a prompt type, instance of the XPrompt class.
- a prompt configuration (defaultXPConfig 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)
- an action to be run: the action must take a string and return X ()
|
|
|
Same as mkXPrompt, except that the action function can have
type String -> X a, for any a, and the final action returned
by mkXPromptWithReturn will have type X (Maybe a). Nothing
is yielded if the user cancels the prompt (by e.g. hitting Esc or
Ctrl-G). For an example of use, see the XMonad.Prompt.Input
module.
|
|
|
|
|
|
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | XPC | | font :: String | Font
| bgColor :: String | Background color
| fgColor :: String | Font color
| fgHLight :: String | Font color of a highlighted completion entry
| bgHLight :: String | Background color of a highlighted completion entry
| borderColor :: String | Border color
| promptBorderWidth :: !Dimension | Border width
| position :: XPPosition | Position: Top or Bottom
| height :: !Dimension | Window height
| historySize :: !Int | The number of history entries to be saved
| historyFilter :: [String] -> [String] | a filter to determine which
history entries to remember
| defaultText :: String | The text by default in the prompt line
| autoComplete :: Maybe Int | Just x: if only one completion remains, auto-select it,
| showCompletionOnTab :: Bool | Only show list of completions when Tab was pressed
and delay by x microseconds
|
|
|
|
|
|
The class prompt types must be an instance of. In order to
create a prompt you need to create a data type, without parameters,
and make it an instance of this class, by implementing a simple
method, showXPrompt, which will be used to print the string to be
displayed in the command line window.
This is an example of a XPrompt instance definition:
instance XPrompt Shell where
showXPrompt Shell = "Run: "
| | Methods | | This method is used to print the string to be
displayed in the command line window.
| | | This method is used to generate the next completion to be
printed in the command line when tab is pressed, given the
string presently in the command line and the list of
completion.
| | | This method is used to generate the string to be passed to
the completion function.
| | | This method is used to process each completion in order to
generate the string that will be compared with the command
presently displayed in the command line. If the prompt is using
getNextOfLastWord for implementing nextCompletion (the
default implementation), this method is also used to generate,
from the returned completion, the string that will form the
next command line when tab is pressed.
|
| | Instances | |
|
|
|
|
X Utilities
|
|
|
|
|
Creates a window with the attribute override_redirect set to True.
Windows Managers should not touch this kind of windows.
|
|
|
Fills a Drawable with a rectangle and a border
|
|
Other Utilities
|
|
|
|
|
This function takes a list of possible completions and returns a
completions function to be used with mkXPrompt
|
|
|
This function takes a list of possible completions and returns a
completions function to be used with mkXPrompt. If the string is
null it will return all completions.
|
|
nextCompletion implementations
|
|
|
Given the prompt type, the command line and the completion list,
return the next completion in the list for the last word of the
command line. This is the default nextCompletion implementation.
|
|
|
An alternative nextCompletion implementation: given a command
and a completion list, get the next completion in the list matching
the whole command line.
|
|
List utilities
|
|
|
Gets the last word of a string or the whole string if formed by
only one word
|
|
|
Skips the last word of the string, if the string is composed by
more then one word. Otherwise returns the string.
|
|
splitInSubListsAt :: Int -> [a] -> [[a]] | Source |
|
Given a maximum length, splits a list into sublists
|
|
|
|
|
Sort a list and remove duplicates. Like deleteAllDuplicates, but trades off
laziness and stability for efficiency.
|
|
|
|
|
|
|
historyCompletion provides a canned completion function much like
getShellCompl; you pass it to mkXPrompt, and it will make completions work
from the query history stored in ~/.xmonad/history.
|
|
History filters
|
|
|
|
|
Functions to be used with the historyFilter setting.
deleteAllDuplicates will remove all duplicate entries.
deleteConsecutive will only remove duplicate elements
immediately next to each other.
|
|
Produced by Haddock version 2.4.2 |