XMonad.Prompt.ConfirmPrompt

xmonad-contrib-0.12: Third party extensions for xmonad

Copyright | (C) 2015 Antoine Beaupré
License | BSD3
Maintainer | Antoine Beaupré <anarcat@debian.org>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Prompt.ConfirmPrompt

Contents

- Usage
- Use case: confirming exit

Description

A module for setting up simple confirmation prompts for keybindings.

Synopsis

- confirmPrompt :: XPConfig -> String -> X () -> X ()
- module XMonad.Prompt
- data EnterPrompt

# Documentation

confirmPrompt :: XPConfig -> String -> X () -> X () #

Prompt the user to confirm a given action. We offer no completion and simply ask to confirm (ENTER) or cancel (ESCAPE). The actual key handling is done by mkXPrompt.

# Usage

This module makes it easy to add a confirmation prompt for specific actions. Instead of just running the action, a simple confirmation prompt will be created using `Prompt` primitives. The action will then run normally if the user confirms.

module XMonad.Prompt

# Use case: confirming exit

This should be used something like this:

    ...
    , ((modm , xK_l), confirmPrompt defaultXPConfig "exit" $ io (exitWith ExitSuccess))
    ...

data EnterPrompt #

Customized `XPrompt` prompt that will ask to confirm the given string

Instances

XPrompt EnterPrompt # |
Methods showXPrompt :: EnterPrompt -> String # nextCompletion :: EnterPrompt -> String -> [String] -> String # commandToComplete :: EnterPrompt -> String -> String # completionToCommand :: EnterPrompt -> String -> String # completionFunction :: EnterPrompt -> ComplFunction # modeAction :: EnterPrompt -> String -> String -> X () #