xmonad-contrib-0.10: Third party extensions for xmonad

Portability | unportable
Stability | unstable
Maintainer | zhen.sydow@gmail.com

XMonad.Prompt.AppLauncher

Contents

- Usage
- Use case: launching gimp with file
- Types

Description

A module for launch applicationes that receive parameters in the command line. The launcher call a prompt to get the parameters.

Synopsis

- launchApp :: XPConfig -> Application -> X ()
- module XMonad.Prompt
- type Application = String
- data AppPrompt

# Usage

This module is intended to allow the launch of the same application but changing the parameters using the user response. For example, when you want to open a image in gimp program, you can open gimp and then use the File Menu to open the image or you can use this module to select the image in the command line.

We use Prompt to get the user command line. This also allow to autoexpand the names of the files when we are writing the command line.

launchApp :: XPConfig -> Application -> X ()

Get the user's response to a prompt an launch an application using the input as command parameters of the application.

module XMonad.Prompt

# Use case: launching gimp with file

First, you need to import necessary modules. Prompt is used to get the promp configuration and the AppLauncher module itself.

     import XMonad.Prompt
     import XMonad.Prompt.AppLauncher as AL

Then you can add the bindings to the applications.

     ...
     , ((modm, xK_g), AL.launchApp defaultXPConfig "gimp" )
     , ((modm, xK_g), AL.launchApp defaultXPConfig "evince" )
     ...

# Types

type Application = String

data AppPrompt

Instances

XPrompt AppPrompt |