xmonad-contrib-0.16.999: Third party extensions for xmonad
Copyright(C) 2008 Luis Cabellos
LicenseBSD3
Maintainerzhen.sydow@gmail.com
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

XMonad.Prompt.AppLauncher

Description

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

Synopsis

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 () Source #

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

class XPrompt t where Source #

A class for an abstract prompt. In order for your data type to be a valid prompt you _must_ make it an instance of this class.

The minimal complete definition is just showXPrompt, i.e. the name of the prompt. This string will be displayed in the command line window (before the cursor).

As an example of a complete XPrompt instance definition, we can look at the Shell prompt from XMonad.Prompt.Shell:

    data Shell = Shell

    instance XPrompt Shell where
         showXPrompt Shell = "Run: "

Methods

showXPrompt :: t -> String Source #

This method is used to print the string to be displayed in the command line window.

Instances

Instances details
XPrompt XPType Source # 
Instance details

Defined in XMonad.Prompt

XPrompt Zsh Source # 
Instance details

Defined in XMonad.Prompt.Zsh

XPrompt XMonad Source # 
Instance details

Defined in XMonad.Prompt.XMonad

XPrompt Wor Source # 
Instance details

Defined in XMonad.Prompt.Workspace

XPrompt Ssh Source # 
Instance details

Defined in XMonad.Prompt.Ssh

XPrompt Shell Source # 
Instance details

Defined in XMonad.Prompt.Shell

XPrompt RunOrRaisePrompt Source # 
Instance details

Defined in XMonad.Prompt.RunOrRaise

XPrompt OrgMode Source # 
Instance details

Defined in XMonad.Prompt.OrgMode

XPrompt Man Source # 
Instance details

Defined in XMonad.Prompt.Man

XPrompt InputPrompt Source # 
Instance details

Defined in XMonad.Prompt.Input

XPrompt Dir Source # 
Instance details

Defined in XMonad.Prompt.Directory

XPrompt DirExec Source # 
Instance details

Defined in XMonad.Prompt.DirExec

XPrompt EnterPrompt Source # 
Instance details

Defined in XMonad.Prompt.ConfirmPrompt

XPrompt AppendFile Source # 
Instance details

Defined in XMonad.Prompt.AppendFile

XPrompt AppPrompt Source # 
Instance details

Defined in XMonad.Prompt.AppLauncher

XPrompt TagPrompt Source # 
Instance details

Defined in XMonad.Actions.TagWindows

XPrompt WindowPrompt Source # 
Instance details

Defined in XMonad.Prompt.Window

XPrompt WSGPrompt Source # 
Instance details

Defined in XMonad.Actions.DynamicWorkspaceGroups

XPrompt Search Source # 
Instance details

Defined in XMonad.Actions.Search

XPrompt ThemePrompt Source # 
Instance details

Defined in XMonad.Prompt.Theme

data XPConfig Source #

Instances

Instances details
Default XPConfig Source # 
Instance details

Defined in XMonad.Prompt

Methods

def :: XPConfig #

mkXPrompt :: XPrompt p => p -> XPConfig -> ComplFunction -> (String -> X ()) -> X () Source #

Creates a prompt given:

  • a prompt type, instance of the XPrompt class.
  • a prompt configuration (def 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 ()

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 def "gimp" )
, ((modm, xK_g), AL.launchApp def "evince" )
...

Types