Sophie

Sophie

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

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.Actions.CopyWindow</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-Actions-CopyWindow.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Actions-CopyWindow.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>???</td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Actions.CopyWindow</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Usage
</a></li><li><a href="#g:2">Highlight workspaces containing copies in logHook
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Provides bindings to duplicate a window on multiple workspaces,
 providing dwm-like tagging functionality.
</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"><a href="#v:copy">copy</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> s, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a) =&gt; i -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd</li><li class="src short"><a href="#v:copyToAll">copyToAll</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> s, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a) =&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd</li><li class="src short"><a href="#v:copyWindow">copyWindow</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> s) =&gt; a -&gt; i -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd</li><li class="src short"><a href="#v:runOrCopy">runOrCopy</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:Query">Query</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</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:killAllOtherCopies">killAllOtherCopies</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:kill1">kill1</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:wsContainingCopies">wsContainingCopies</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/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a>]</li></ul></div><div id="interface"><h1 id="g:1">Usage
</h1><div class="doc"><p>You can use this module with the following in your <code>~/.xmonad/xmonad.hs</code> file:
</p><pre> import XMonad.Actions.CopyWindow
</pre><p>Then add something like this to your keybindings:
</p><pre> -- mod-[1..9] @@ Switch to workspace N
 -- mod-shift-[1..9] @@ Move client to workspace N
 -- mod-control-shift-[1..9] @@ Copy client to workspace N
 [((m .|. modm, k), windows $ f i)
     | (i, k) &lt;- zip (workspaces x) [xK_1 ..]
     , (f, m) &lt;- [(W.view, 0), (W.shift, shiftMask), (copy, shiftMask .|. controlMask)]]
</pre><p>To use the above key bindings you need also to import
 <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html">XMonad.StackSet</a>:
</p><pre> import qualified XMonad.StackSet as W
</pre><p>You may also wish to redefine the binding to kill a window so it only
 removes it from the current workspace, if it's present elsewhere:
</p><pre>  , ((modm .|. shiftMask, xK_c     ), kill1) -- @@ Close the focused window
</pre><p>Instead of copying a window from one workspace to another maybe you don't
 want to have to remember where you placed it.  For that consider:
</p><pre>  , ((modm, xK_b    ), runOrCopy &quot;firefox&quot; (className =? &quot;Firefox&quot;)) -- @@ run or copy firefox
</pre><p>Another possibility which this extension provides is 'making window
 always visible' (i.e. always on current workspace), similar to corresponding
 metacity functionality. This behaviour is emulated through copying given
 window to all the workspaces and then removing it when it's unneeded on
 all workspaces any more.
</p><p>Here is the example of keybindings which provide these actions:
</p><pre>  , ((modm, xK_v ), windows copyToAll) -- @@ Make focused window always visible
  , ((modm .|. shiftMask, xK_v ),  killAllOtherCopies) -- @@ Toggle window state back
</pre><p>For detailed instructions on editing your key bindings, see
 <a href="XMonad-Doc-Extending.html#Editing_key_bindings">XMonad.Doc.Extending</a>.
</p></div><div class="top"><p class="src"><a name="v:copy" class="def">copy</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> s, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a) =&gt; i -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd<a href="src/XMonad-Actions-CopyWindow.html#copy" class="link">Source</a></p><div class="doc"><p>Copy the focused window to a workspace.
</p></div></div><div class="top"><p class="src"><a name="v:copyToAll" class="def">copyToAll</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> s, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a) =&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd<a href="src/XMonad-Actions-CopyWindow.html#copyToAll" class="link">Source</a></p><div class="doc"><p>Copy the focused window to all workspaces.
</p></div></div><div class="top"><p class="src"><a name="v:copyWindow" class="def">copyWindow</a> :: (<a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> i, <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Eq.html#t:Eq">Eq</a> s) =&gt; a -&gt; i -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd -&gt; <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-StackSet.html#t:StackSet">StackSet</a> i l a s sd<a href="src/XMonad-Actions-CopyWindow.html#copyWindow" class="link">Source</a></p><div class="doc"><p>Copy an arbitrary window to a workspace.
</p></div></div><div class="top"><p class="src"><a name="v:runOrCopy" class="def">runOrCopy</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:Query">Query</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.5.0.0/Data-Bool.html#t:Bool">Bool</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-Actions-CopyWindow.html#runOrCopy" class="link">Source</a></p><div class="doc"><p>runOrCopy will run the provided shell command unless it can
  find a specified window in which case it will copy the window to
  the current workspace.  Similar to (i.e., stolen from) <a href="XMonad-Actions-WindowGo.html">XMonad.Actions.WindowGo</a>.
</p></div></div><div class="top"><p class="src"><a name="v:killAllOtherCopies" class="def">killAllOtherCopies</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-Actions-CopyWindow.html#killAllOtherCopies" class="link">Source</a></p><div class="doc"><p>Kill all other copies of focused window (if they're present).
 'All other' means here 'copies which are not on the current workspace'.
</p></div></div><div class="top"><p class="src"><a name="v:kill1" class="def">kill1</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-Actions-CopyWindow.html#kill1" class="link">Source</a></p><div class="doc"><p>Remove the focused window from this workspace.  If it's present in no
 other workspace, then kill it instead. If we do kill it, we'll get a
 delete notify back from X.
</p><p>There are two ways to delete a window. Either just kill it, or if it
 supports the delete protocol, send a delete event (e.g. firefox).
</p></div></div><h1 id="g:2">Highlight workspaces containing copies in logHook
</h1><div class="doc"><p>To distinguish workspaces containing copies of the focused window use
 something like:
</p><pre> sampleLogHook h = do
    copies &lt;- wsContainingCopies
    let check ws | ws `elem` copies = pad . xmobarColor &quot;red&quot; &quot;black&quot; $ ws
                 | otherwise = pad ws
    dynamicLogWithPP myPP {ppHidden = check, ppOutput = hPutStrLn h}

 main = do
    h &lt;- spawnPipe &quot;xmobar&quot;
    xmonad defaultConfig { logHook = sampleLogHook h }
</pre></div><div class="top"><p class="src"><a name="v:wsContainingCopies" class="def">wsContainingCopies</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/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a>]<a href="src/XMonad-Actions-CopyWindow.html#wsContainingCopies" class="link">Source</a></p><div class="doc"><p>A list of hidden workspaces containing a copy of the focused window.
</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>