Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 16551e78563a5b49ff9624ee1c8b8101 > files > 919

ghc-xmonad-contrib-devel-0.11-1.1.fc18.i686.rpm

<!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.Util.XSelection</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-Util-XSelection.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Util-XSelection.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>Gwern Branwen &lt;gwern0@gmail.com&gt;</td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Util.XSelection</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Usage
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A module for accessing and manipulating X Window's mouse selection (the buffer used in copy and pasting).
<code><a href="XMonad-Util-XSelection.html#v:getSelection">getSelection</a></code> is an adaptation of Hxsel.hs and Hxput.hs from the XMonad-utils, available:
</p><pre> $ darcs get &lt;http://gorgias.mine.nu/repos/xmonad-utils&gt;
</pre></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"><a href="#v:getSelection">getSelection</a> :: <a href="/usr/share/doc/ghc/html/libraries/transformers-0.3.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m =&gt; m <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:promptSelection">promptSelection</a>, <a href="#v:safePromptSelection">safePromptSelection</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <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:transformPromptSelection">transformPromptSelection</a>, <a href="#v:transformSafePromptSelection">transformSafePromptSelection</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>) -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <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></ul></div><div id="interface"><h1 id="g:1">Usage
</h1><div class="doc"><p>Add <code>import XMonad.Util.XSelection</code> to the top of Config.hs
   Then make use of getSelection or promptSelection as needed; if
   one wanted to run Firefox with the selection as an argument (perhaps
   the selection string is an URL you just highlighted), then one could add
   to the xmonad.hs a line like thus:
</p><pre> , ((modm .|. shiftMask, xK_b), promptSelection &quot;firefox&quot;)
</pre><p>Future improvements for XSelection:
</p><ul><li> More elaborate functionality: Emacs' registers are nice; if you
      don't know what they are, see <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html#Registers">http://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html#Registers</a> 
</li></ul></div><div class="top"><p class="src"><a name="v:getSelection" class="def">getSelection</a> :: <a href="/usr/share/doc/ghc/html/libraries/transformers-0.3.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m =&gt; m <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a><a href="src/XMonad-Util-XSelection.html#getSelection" class="link">Source</a></p><div class="doc"><p>Returns a String corresponding to the current mouse selection in X;
   if there is none, an empty string is returned.
</p></div></div><div class="top"><p class="src"><a name="v:promptSelection" class="def">promptSelection</a>, <a name="v:safePromptSelection" class="def">safePromptSelection</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <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-Util-XSelection.html#promptSelection" class="link">Source</a></p><div class="doc"><p>A wrapper around <code><a href="XMonad-Util-XSelection.html#v:getSelection">getSelection</a></code>. Makes it convenient to run a program with the current selection as an argument.
  This is convenient for handling URLs, in particular. For example, in your Config.hs you could bind a key to
         <code>promptSelection &quot;firefox&quot;</code>;
  this would allow you to highlight a URL string and then immediately open it up in Firefox.
</p><p><code><a href="XMonad-Util-XSelection.html#v:promptSelection">promptSelection</a></code> passes strings through the system shell, /bin/sh; if you do not wish your selected text
  to be interpreted or mangled by the shell, use <code><a href="XMonad-Util-XSelection.html#v:safePromptSelection">safePromptSelection</a></code>. safePromptSelection will bypass the
  shell using <code><a href="XMonad-Util-Run.html#v:safeSpawn">safeSpawn</a></code> from <a href="XMonad-Util-Run.html">XMonad.Util.Run</a>; see its documentation for more
  details on the advantages and disadvantages of using safeSpawn. 
</p></div></div><div class="top"><p class="src"><a name="v:transformPromptSelection" class="def">transformPromptSelection</a>, <a name="v:transformSafePromptSelection" class="def">transformSafePromptSelection</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a>) -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-String.html#t:String">String</a> -&gt; <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-Util-XSelection.html#transformPromptSelection" class="link">Source</a></p><div class="doc"><p>A wrapper around <code><a href="XMonad-Util-XSelection.html#v:promptSelection">promptSelection</a></code> and its safe variant. They take two parameters, the
     first is a function that transforms strings, and the second is the application to run.
     The transformer essentially transforms the selection in X.
     One example is to wrap code, such as a command line action copied out of the browser
     to be run as <code><a href="sudo.html">sudo</a> ++ cmd</code> or <code><a href="su - -c &quot;.html">su - -c &quot;</a>++ cmd ++<a href="&quot;.html">&quot;</a></code>. 
</p></div></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>