xmonad-extras-0.17.2: Third party extensions for xmonad with wacky dependencies

Copyright | Daniel Schoepe <daniel.schoepe@gmail.com>
License | BSD3
Maintainer | Daniel Schoepe <daniel.schoepe@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

XMonad.Prompt.Eval

Contents

- Usage

Description

A prompt for evaluating Haskell expressions (in the context of the running xmonad instance).

Synopsis

- evalPrompt :: EvalConfig -> XPConfig -> X ()
- evalPromptWithOutput :: EvalConfig -> XPConfig -> (String -> X ()) -> X ()
- showWithDzen :: Int -> [String] -> String -> X ()

# Usage

You can use this module with the following in your `~/.xmonad/xmonad.hs`:

    import XMonad.Prompt
    import XMonad.Prompt.Eval

in your keybindings add:

      , ((modMask x .|. controlMask, xK_x), evalPrompt defaultEvalConfig)

For detailed instruction on editing the key binding see XMonad.Doc.Extending.

evalPrompt :: EvalConfig -> XPConfig -> X () Source #

A prompt that evaluates the entered Haskell expression, whose type has to be an instance of Show.

evalPromptWithOutput :: EvalConfig -> XPConfig -> (String -> X ()) -> X () Source #

The same as `evalPrompt`, but lets the user supply a function to be executed on the returned string, which is produced by applying show to the executed expression. (This is a crude solution, but the returned type has to be monomorphic)

showWithDzen :: Int -> [String] -> String -> X () Source #

A nice default to have the result of an expression displayed by dzen, if it's interesting (i.e. not () or an empty string). The first parameter specifies the display time in microseconds, the second parameter allows to pass additional options to dzen.