<!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.OnScreen</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-OnScreen.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/XMonad-Actions-OnScreen.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>Nils Schweinsberg <mail@n-sch.de></td></tr><tr><th>Safe Haskell</th><td>Safe-Infered</td></tr></table><p class="caption">XMonad.Actions.OnScreen</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>Control workspaces on different screens (in xinerama mode). </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:onScreen">onScreen</a> :: (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a>) -> <a href="XMonad-Actions-OnScreen.html#t:Focus">Focus</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></li><li class="src short"><a href="#v:onScreen-39-">onScreen'</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="XMonad-Actions-OnScreen.html#t:Focus">Focus</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</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"><span class="keyword">data</span> <a href="#t:Focus">Focus</a> <ul class="subs"><li>= <a href="#v:FocusNew">FocusNew</a> </li><li>| <a href="#v:FocusCurrent">FocusCurrent</a> </li><li>| <a href="#v:FocusTag">FocusTag</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a> </li><li>| <a href="#v:FocusTagVisible">FocusTagVisible</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a> </li></ul></li><li class="src short"><a href="#v:viewOnScreen">viewOnScreen</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></li><li class="src short"><a href="#v:greedyViewOnScreen">greedyViewOnScreen</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></li><li class="src short"><a href="#v:onlyOnScreen">onlyOnScreen</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></li><li class="src short"><a href="#v:toggleOnScreen">toggleOnScreen</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></li><li class="src short"><a href="#v:toggleGreedyOnScreen">toggleGreedyOnScreen</a> :: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></li></ul></div><div id="interface"><h1 id="g:1">Usage </h1><div class="doc"><p>This module provides an easy way to control, what you see on other screens in xinerama mode without having to focus them. Put this into your <code>~/.xmonad/xmonad.hs</code>: </p><pre> import XMonad.Actions.OnScreen </pre><p>Then add the appropriate keybindings, for example replace your current keys to switch the workspaces with this at the bottom of your keybindings: </p><pre> ++ [ ((m .|. modm, k), windows (f i)) | (i, k) <- zip (workspaces conf) ([xK_1 .. xK_9] ++ [xK_0]) , (f, m) <- [ (viewOnScreen 0, 0) , (viewOnScreen 1, controlMask) , (greedyView, controlMask .|. shiftMask) ] ] </pre><p>This will provide you with the following keybindings: </p><ul><li> modkey + 1-0: Switch to workspace 1-0 on screen 0 </li><li> modkey + control + 1-0: Switch to workspace 1-0 on screen 1 </li><li> modkey + control + shift + 1-0: Default greedyView behaviour </li></ul><p>A more basic version inside the default keybindings would be: </p><pre> , ((modm .|. controlMask, xK_1), windows (viewOnScreen 0 "1")) </pre><p>where 0 is the first screen and "1" the workspace with the tag "1". </p><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:onScreen" class="def">onScreen</a><a href="src/XMonad-Actions-OnScreen.html#onScreen" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a> -> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a>)</td><td class="doc"><p>function to run </p></td></tr><tr><td class="src">-> <a href="XMonad-Actions-OnScreen.html#t:Focus">Focus</a></td><td class="doc"><p>what to do with the focus </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a></td><td class="doc"><p>screen id </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc"><p>current stack </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Run any function that modifies the stack on a given screen. This function will also need to know which Screen to focus after the function has been run. </p></div></div><div class="top"><p class="src"><a name="v:onScreen-39-" class="def">onScreen'</a><a href="src/XMonad-Actions-OnScreen.html#onScreen%27" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <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></td><td class="doc"><p>X function to run </p></td></tr><tr><td class="src">-> <a href="XMonad-Actions-OnScreen.html#t:Focus">Focus</a></td><td class="doc"><p>focus </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a></td><td class="doc"><p>screen id </p></td></tr><tr><td class="src">-> <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></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>A variation of <code>onScreen</code> which will take any <code>X ()</code> function and run it on the given screen. Warning: This function will change focus even if the function it's supposed to run doesn't succeed. </p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Focus" class="def">Focus</a> <a href="src/XMonad-Actions-OnScreen.html#Focus" class="link">Source</a></p><div class="doc"><p>Focus data definitions </p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:FocusNew" class="def">FocusNew</a></td><td class="doc"><p>always focus the new screen </p></td></tr><tr><td class="src"><a name="v:FocusCurrent" class="def">FocusCurrent</a></td><td class="doc"><p>always keep the focus on the current screen </p></td></tr><tr><td class="src"><a name="v:FocusTag" class="def">FocusTag</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a></td><td class="doc"><p>always focus tag i on the new stack </p></td></tr><tr><td class="src"><a name="v:FocusTagVisible" class="def">FocusTagVisible</a> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a></td><td class="doc"><p>focus tag i only if workspace with tag i is visible on the old stack </p></td></tr></table></div></div><div class="top"><p class="src"><a name="v:viewOnScreen" class="def">viewOnScreen</a><a href="src/XMonad-Actions-OnScreen.html#viewOnScreen" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a></td><td class="doc"><p>screen id </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a></td><td class="doc"><p>index of the workspace </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc"><p>current stack </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Switch to workspace <code>i</code> on screen <code>sc</code>. If <code>i</code> is visible use <code>view</code> to switch focus to the workspace <code>i</code>. </p></div></div><div class="top"><p class="src"><a name="v:greedyViewOnScreen" class="def">greedyViewOnScreen</a><a href="src/XMonad-Actions-OnScreen.html#greedyViewOnScreen" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a></td><td class="doc"><p>screen id </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a></td><td class="doc"><p>index of the workspace </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc"><p>current stack </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Switch to workspace <code>i</code> on screen <code>sc</code>. If <code>i</code> is visible use <code>greedyView</code> to switch the current workspace with workspace <code>i</code>. </p></div></div><div class="top"><p class="src"><a name="v:onlyOnScreen" class="def">onlyOnScreen</a><a href="src/XMonad-Actions-OnScreen.html#onlyOnScreen" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a></td><td class="doc"><p>screen id </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a></td><td class="doc"><p>index of the workspace </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc"><p>current stack </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Switch to workspace <code>i</code> on screen <code>sc</code>. If <code>i</code> is visible do nothing. </p></div></div><div class="top"><p class="src"><a name="v:toggleOnScreen" class="def">toggleOnScreen</a><a href="src/XMonad-Actions-OnScreen.html#toggleOnScreen" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a></td><td class="doc"><p>screen id </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a></td><td class="doc"><p>index of the workspace </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc"><p>current stack </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p><code>toggleOrView</code> as in <a href="XMonad-Actions-CycleWS.html">XMonad.Actions.CycleWS</a> for <code>onScreen</code> with view </p></div></div><div class="top"><p class="src"><a name="v:toggleGreedyOnScreen" class="def">toggleGreedyOnScreen</a><a href="src/XMonad-Actions-OnScreen.html#toggleGreedyOnScreen" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:ScreenId">ScreenId</a></td><td class="doc"><p>screen id </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WorkspaceId">WorkspaceId</a></td><td class="doc"><p>index of the workspace </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc"><p>current stack </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/xmonad-0.11/XMonad-Core.html#t:WindowSet">WindowSet</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p><code>toggleOrView</code> from <a href="XMonad-Actions-CycleWS.html">XMonad.Actions.CycleWS</a> for <code>onScreen</code> with greedyView </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>