<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>XMonad.Prompt.Shell</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_XMonad-Prompt-Shell.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Prompt-Shell.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">xmonad-contrib-0.11: Third party extensions for xmonad</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>unportable</td></tr><tr><th>Stability</th><td>unstable</td></tr><tr><th>Maintainer</th><td>andrea.rossato@unibz.it</td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Prompt.Shell</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Usage </a><ul><li><a href="#g:2">Variations on shellPrompt </a></li></ul></li><li><a href="#g:3">Utility functions </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A shell prompt for XMonad </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Shell">Shell</a> = <a href="#v:Shell">Shell</a></li><li class="src short"><a href="#v:shellPrompt">shellPrompt</a> :: <a href="XMonad-Prompt.html#t:XPConfig">XPConfig</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:prompt">prompt</a>, <a href="#v:safePrompt">safePrompt</a>, <a href="#v:unsafePrompt">unsafePrompt</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="XMonad-Prompt.html#t:XPConfig">XPConfig</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:getCommands">getCommands</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> [<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:getBrowser">getBrowser</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:getEditor">getEditor</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:getShellCompl">getShellCompl</a> :: [<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> [<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:split">split</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a => a -> [a] -> [[a]]</li></ul></div><div id="interface"><h1 id="g:1">Usage </h1><div class="doc"><ol><li> In your <code>~/.xmonad/xmonad.hs</code>: </li></ol><pre> import XMonad.Prompt import XMonad.Prompt.Shell </pre><ol><li> In your keybindings add something like: </li></ol><pre> , ((modm .|. controlMask, xK_x), shellPrompt defaultXPConfig) </pre><p>For detailed instruction on editing the key binding see <a href="XMonad-Doc-Extending.html#Editing_key_bindings">XMonad.Doc.Extending</a>. </p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Shell" class="def">Shell</a> <a href="src/XMonad-Prompt-Shell.html#Shell" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Shell" class="def">Shell</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Shell" class="caption collapser" onclick="toggleSection('i:Shell')">Instances</p><div id="section.i:Shell" class="show"><table><tr><td class="src"><a href="XMonad-Prompt.html#t:XPrompt">XPrompt</a> <a href="XMonad-Prompt-Shell.html#t:Shell">Shell</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:shellPrompt" class="def">shellPrompt</a> :: <a href="XMonad-Prompt.html#t:XPConfig">XPConfig</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Prompt-Shell.html#shellPrompt" class="link">Source</a></p></div><h2 id="g:2">Variations on shellPrompt </h2><div class="doc"><p>See safe and unsafeSpawn in <a href="XMonad-Util-Run.html">XMonad.Util.Run</a>. prompt is an alias for safePrompt; safePrompt and unsafePrompt work on the same principles, but will use XPrompt to interactively query the user for input; the appearance is set by passing an XPConfig as the second argument. The first argument is the program to be run with the interactive input. You would use these like this: </p><pre> , ((modm, xK_b), safePrompt "firefox" greenXPConfig) , ((modm .|. shiftMask, xK_c), prompt ("xterm" ++ " -e") greenXPConfig) </pre><p>Note that you want to use safePrompt for Firefox input, as Firefox wants URLs, and unsafePrompt for the XTerm example because this allows you to easily start a terminal executing an arbitrary command, like <code>top</code>. </p></div><div class="top"><p class="src"><a name="v:prompt" class="def">prompt</a>, <a name="v:safePrompt" class="def">safePrompt</a>, <a name="v:unsafePrompt" class="def">unsafePrompt</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="XMonad-Prompt.html#t:XPConfig">XPConfig</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:X">X</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a><a href="src/XMonad-Prompt-Shell.html#prompt" class="link">Source</a></p></div><h1 id="g:3">Utility functions </h1><div class="top"><p class="src"><a name="v:getCommands" class="def">getCommands</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> [<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>]<a href="src/XMonad-Prompt-Shell.html#getCommands" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:getBrowser" class="def">getBrowser</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a><a href="src/XMonad-Prompt-Shell.html#getBrowser" class="link">Source</a></p><div class="doc"><p>Ask the shell what browser the user likes. If the user hasn't defined any $BROWSER, defaults to returning "firefox", since that seems to be the most common X web browser. Note that if you don't specify a GUI browser but a textual one, that'll be a problem as <code><a href="XMonad-Prompt-Shell.html#v:getBrowser">getBrowser</a></code> will be called by functions expecting to be able to just execute the string or pass it to a shell; so in that case, define $BROWSER as something like "xterm -e elinks" or as the name of a shell script doing much the same thing. </p></div></div><div class="top"><p class="src"><a name="v:getEditor" class="def">getEditor</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a><a href="src/XMonad-Prompt-Shell.html#getEditor" class="link">Source</a></p><div class="doc"><p>Like <code><a href="XMonad-Prompt-Shell.html#v:getBrowser">getBrowser</a></code>, but should be of a text editor. This gets the $EDITOR variable, defaulting to "emacs". </p></div></div><div class="top"><p class="src"><a name="v:getShellCompl" class="def">getShellCompl</a> :: [<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/System-IO.html#t:IO">IO</a> [<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>]<a href="src/XMonad-Prompt-Shell.html#getShellCompl" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:split" class="def">split</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a => a -> [a] -> [[a]]<a href="src/XMonad-Prompt-Shell.html#split" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.10.0</p></div></body></html>