<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--Rendered using the Haskell Html Library v0.2--> <HTML ><HEAD ><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" ><TITLE >XMonad.Actions.CycleWS</TITLE ><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" ><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" ></SCRIPT ><SCRIPT TYPE="text/javascript" >window.onload = function () {setSynopsis("mini_XMonad-Actions-CycleWS.html")};</SCRIPT ></HEAD ><BODY ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="topbar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " ></TD ><TD CLASS="title" >xmonad-contrib-0.9.1: Third party extensions for xmonad</TD ><TD CLASS="topbut" ><A HREF="src/XMonad-Actions-CycleWS.html" >Source code</A ></TD ><TD CLASS="topbut" ><A HREF="index.html" >Contents</A ></TD ><TD CLASS="topbut" ><A HREF="doc-index.html" >Index</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="modulebar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><FONT SIZE="6" >XMonad.Actions.CycleWS</FONT ></TD ><TD ALIGN="right" ><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="infohead" >Portability</TD ><TD CLASS="infoval" >unportable</TD ></TR ><TR ><TD CLASS="infohead" >Stability</TD ><TD CLASS="infoval" >unstable</TD ></TR ><TR ><TD CLASS="infohead" >Maintainer</TD ><TD CLASS="infoval" >Joachim Breitner <mail@joachim-breitner.de></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" ><B >Contents</B ></TD ></TR ><TR ><TD ><DL ><DT ><A HREF="#1" >Usage </A ></DT ><DT ><A HREF="#2" >Moving between workspaces </A ></DT ><DT ><A HREF="#3" >Toggling the previous workspace </A ></DT ><DT ><A HREF="#4" >Moving between screens (xinerama) </A ></DT ><DT ><A HREF="#5" >Moving between workspaces, take two! </A ></DT ><DT ><A HREF="#6" >The mother-combinator </A ></DT ></DL ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" ><P >Provides bindings to cycle forward or backward through the list of workspaces, to move windows between workspaces, and to cycle between screens. More general combinators provide ways to cycle through workspaces in various orders, to only cycle through some subset of workspaces, and to cycle by more than one workspace at a time. </P ><P >Note that this module now subsumes the functionality of the former <TT >XMonad.Actions.RotView</TT >. Former users of <TT >rotView</TT > can simply replace <TT >rotView True</TT > with <TT >moveTo Next NonEmptyWS</TT >, and so on. </P ><P >If you want to exactly replicate the action of <TT >rotView</TT > (cycling through workspace in order lexicographically by tag, instead of in the order specified in the config), it can be implemented as: </P ><PRE > rotView b = do t <- findWorkspace getSortByTag (bToDir b) NonEmptyWS 1 windows . greedyView $ t where bToDir True = Next bToDir False = Prev </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Synopsis</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="#v%3AnextWS" >nextWS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AprevWS" >prevWS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AshiftToNext" >shiftToNext</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AshiftToPrev" >shiftToPrev</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AtoggleWS" >toggleWS</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AtoggleOrView" >toggleOrView</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AnextScreen" >nextScreen</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AprevScreen" >prevScreen</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AshiftNextScreen" >shiftNextScreen</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AshiftPrevScreen" >shiftPrevScreen</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AswapNextScreen" >swapNextScreen</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AswapPrevScreen" >swapPrevScreen</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3ADirection1D" >Direction1D</A > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" >= <A HREF="#v%3ANext" >Next</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3APrev" >Prev</A ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AWSType" >WSType</A > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" >= <A HREF="#v%3AEmptyWS" >EmptyWS</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3ANonEmptyWS" >NonEmptyWS</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AHiddenWS" >HiddenWS</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AHiddenNonEmptyWS" >HiddenNonEmptyWS</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AAnyWS" >AnyWS</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AWSIs" >WSIs</A > (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSpace" >WindowSpace</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool" >Bool</A >))</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AshiftTo" >shiftTo</A > :: <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3AWSType" >WSType</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AmoveTo" >moveTo</A > :: <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3AWSType" >WSType</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfindWorkspace" >findWorkspace</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="XMonad-Util-WorkspaceCompare.html#t%3AWorkspaceSort" >WorkspaceSort</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3AWSType" >WSType</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AtoggleOrDoSkip" >toggleOrDoSkip</A > :: [<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A >] -> (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet" >WindowSet</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet" >WindowSet</A >) -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AskipTags" >skipTags</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq" >Eq</A > i => [<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-StackSet.html#t%3AWorkspace" >Workspace</A > i l a] -> [i] -> [<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-StackSet.html#t%3AWorkspace" >Workspace</A > i l a]</TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="1" ><A NAME="1" >Usage </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="doc" ><P >You can use this module with the following in your <TT >~/.xmonad/xmonad.hs</TT > file: </P ><PRE > import XMonad.Actions.CycleWS -- a basic CycleWS setup , ((modm, xK_Down), nextWS) , ((modm, xK_Up), prevWS) , ((modm .|. shiftMask, xK_Down), shiftToNext) , ((modm .|. shiftMask, xK_Up), shiftToPrev) , ((modm, xK_Right), nextScreen) , ((modm, xK_Left), prevScreen) , ((modm .|. shiftMask, xK_Right), shiftNextScreen) , ((modm .|. shiftMask, xK_Left), shiftPrevScreen) , ((modm, xK_z), toggleWS) </PRE ><P >If you want to follow the moved window, you can use both actions: </P ><PRE > , ((modm .|. shiftMask, xK_Down), shiftToNext >> nextWS) , ((modm .|. shiftMask, xK_Up), shiftToPrev >> prevWS) </PRE ><P >You can also get fancier with <TT ><A HREF="XMonad-Actions-CycleWS.html#v%3AmoveTo" >moveTo</A ></TT >, <TT ><A HREF="XMonad-Actions-CycleWS.html#v%3AshiftTo" >shiftTo</A ></TT >, and <TT ><A HREF="XMonad-Actions-CycleWS.html#v%3AfindWorkspace" >findWorkspace</A ></TT >. For example: </P ><PRE > , ((modm , xK_f), moveTo Next EmptyWS) -- find a free workspace , ((modm .|. controlMask, xK_Right), -- a crazy keybinding! do t <- findWorkspace getSortByXineramaRule Next NonEmptyWS 2 windows . view $ t ) </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 ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="2" ><A NAME="2" >Moving between workspaces </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="doc" ><P >The following commands for moving the view and windows between workspaces are somewhat inflexible, but are very simple and probably Do The Right Thing for most users. </P ><P >All of the commands in this section cycle through workspaces in the order in which they are given in your config. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:nextWS" ><A NAME="v%3AnextWS" ></A ></A ><B >nextWS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#nextWS" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Switch to the next workspace. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:prevWS" ><A NAME="v%3AprevWS" ></A ></A ><B >prevWS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#prevWS" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Switch to the previous workspace. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:shiftToNext" ><A NAME="v%3AshiftToNext" ></A ></A ><B >shiftToNext</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#shiftToNext" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Move the focused window to the next workspace. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:shiftToPrev" ><A NAME="v%3AshiftToPrev" ></A ></A ><B >shiftToPrev</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#shiftToPrev" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Move the focused window to the previous workspace. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="3" ><A NAME="3" >Toggling the previous workspace </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="doc" ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:toggleWS" ><A NAME="v%3AtoggleWS" ></A ></A ><B >toggleWS</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#toggleWS" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Toggle to the workspace displayed previously. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:toggleOrView" ><A NAME="v%3AtoggleOrView" ></A ></A ><B >toggleOrView</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#toggleOrView" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-StackSet.html#v%3AgreedyView" >greedyView</A ></TT > a workspace, or if already there, view the previously displayed workspace ala weechat. Change <TT >greedyView</TT > to <TT >toggleOrView</TT > in your workspace bindings as in the <TT ><A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-StackSet.html#v%3Aview" >view</A ></TT > faq at <A HREF="http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions" >http://haskell.org/haskellwiki/Xmonad/Frequently_asked_questions</A >. For more flexibility see <TT ><A HREF="XMonad-Actions-CycleWS.html#v%3AtoggleOrDoSkip" >toggleOrDoSkip</A ></TT >. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="4" ><A NAME="4" >Moving between screens (xinerama) </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:nextScreen" ><A NAME="v%3AnextScreen" ></A ></A ><B >nextScreen</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#nextScreen" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >View next screen </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:prevScreen" ><A NAME="v%3AprevScreen" ></A ></A ><B >prevScreen</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#prevScreen" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >View prev screen </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:shiftNextScreen" ><A NAME="v%3AshiftNextScreen" ></A ></A ><B >shiftNextScreen</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#shiftNextScreen" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Move focused window to workspace on next screen </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:shiftPrevScreen" ><A NAME="v%3AshiftPrevScreen" ></A ></A ><B >shiftPrevScreen</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#shiftPrevScreen" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Move focused window to workspace on prev screen </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:swapNextScreen" ><A NAME="v%3AswapNextScreen" ></A ></A ><B >swapNextScreen</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#swapNextScreen" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Swap current screen with next screen </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:swapPrevScreen" ><A NAME="v%3AswapPrevScreen" ></A ></A ><B >swapPrevScreen</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#swapPrevScreen" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Swap current screen with previous screen </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="5" ><A NAME="5" >Moving between workspaces, take two! </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="doc" ><P >A few more general commands are also provided, which allow cycling through subsets of workspaces. </P ><P >For example, </P ><PRE > moveTo Next EmptyWS </PRE ><P >will move to the first available workspace with no windows, and </P ><PRE > shiftTo Prev (WSIs $ return (('p' `elem`) . tag)) </PRE ><P >will move the focused window backwards to the first workspace containing the letter p in its name. =) </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:Direction1D" ><A NAME="t%3ADirection1D" ></A ></A ><B >Direction1D</B > </TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Util-Types.html#Direction1D" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="ndoc" >One-dimensional directions: </TD ></TR ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:Next" ><A NAME="v%3ANext" ></A ></A ><B >Next</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:Prev" ><A NAME="v%3APrev" ></A ></A ><B >Prev</B ></TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="section4" ><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Direction1D')" ALT="show/hide" > Instances</TD ></TR ><TR ><TD CLASS="body" ><DIV ID="i:Direction1D" STYLE="display:block;" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq" >Eq</A > <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Read.html#t%3ARead" >Read</A > <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow" >Show</A > <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Typeable.html#t%3ATypeable" >Typeable</A > <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:WSType" ><A NAME="t%3AWSType" ></A ></A ><B >WSType</B > </TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#WSType" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="ndoc" >What type of workspaces should be included in the cycle? </TD ></TR ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:EmptyWS" ><A NAME="v%3AEmptyWS" ></A ></A ><B >EmptyWS</B ></TD ><TD CLASS="rdoc" >cycle through empty workspaces </TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:NonEmptyWS" ><A NAME="v%3ANonEmptyWS" ></A ></A ><B >NonEmptyWS</B ></TD ><TD CLASS="rdoc" >cycle through non-empty workspaces </TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:HiddenWS" ><A NAME="v%3AHiddenWS" ></A ></A ><B >HiddenWS</B ></TD ><TD CLASS="rdoc" >cycle through non-visible workspaces </TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:HiddenNonEmptyWS" ><A NAME="v%3AHiddenNonEmptyWS" ></A ></A ><B >HiddenNonEmptyWS</B ></TD ><TD CLASS="rdoc" >cycle through non-empty non-visible workspaces </TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:AnyWS" ><A NAME="v%3AAnyWS" ></A ></A ><B >AnyWS</B ></TD ><TD CLASS="rdoc" >cycle through all workspaces </TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:WSIs" ><A NAME="v%3AWSIs" ></A ></A ><B >WSIs</B > (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSpace" >WindowSpace</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool" >Bool</A >))</TD ><TD CLASS="rdoc" >cycle through workspaces satisfying an arbitrary predicate </TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:shiftTo" ><A NAME="v%3AshiftTo" ></A ></A ><B >shiftTo</B > :: <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3AWSType" >WSType</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#shiftTo" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >Move the currently focused window to the next workspace in the given direction that satisfies the given condition. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:moveTo" ><A NAME="v%3AmoveTo" ></A ></A ><B >moveTo</B > :: <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3AWSType" >WSType</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#moveTo" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >View the next workspace in the given direction that satisfies the given condition. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="6" ><A NAME="6" >The mother-combinator </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:findWorkspace" ><A NAME="v%3AfindWorkspace" ></A ></A ><B >findWorkspace</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="XMonad-Util-WorkspaceCompare.html#t%3AWorkspaceSort" >WorkspaceSort</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3ADirection1D" >Direction1D</A > -> <A HREF="XMonad-Actions-CycleWS.html#t%3AWSType" >WSType</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#findWorkspace" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><P >Given a function <TT >s</TT > to sort workspaces, a direction <TT >dir</TT >, a predicate <TT >p</TT > on workspaces, and an integer <TT >n</TT >, find the tag of the workspace which is <TT >n</TT > away from the current workspace in direction <TT >dir</TT > (wrapping around if necessary), among those workspaces, sorted by <TT >s</TT >, which satisfy <TT >p</TT >. </P ><P >For some useful workspace sorting functions, see <A HREF="XMonad-Util-WorkspaceCompare.html" >XMonad.Util.WorkspaceCompare</A >. </P ><P >For ideas of what to do with a workspace tag once obtained, note that <TT ><A HREF="XMonad-Actions-CycleWS.html#v%3AmoveTo" >moveTo</A ></TT > and <TT ><A HREF="XMonad-Actions-CycleWS.html#v%3AshiftTo" >shiftTo</A ></TT > are implemented by applying <TT >(>>= (windows . greedyView))</TT > and <TT >(>>= (windows . shift))</TT >, respectively, to the output of <TT ><A HREF="XMonad-Actions-CycleWS.html#v%3AfindWorkspace" >findWorkspace</A ></TT >. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:toggleOrDoSkip" ><A NAME="v%3AtoggleOrDoSkip" ></A ></A ><B >toggleOrDoSkip</B > :: [<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A >] -> (<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet" >WindowSet</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWindowSet" >WindowSet</A >) -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AWorkspaceId" >WorkspaceId</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-Core.html#t%3AX" >X</A > <A HREF="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#toggleOrDoSkip" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><P >Allows ignoring listed workspace tags (such as scratchpad's "NSP") while finding the previously displayed workspace, or choice of different actions, like view, shift, etc. For example: </P ><PRE > import qualified XMonad.StackSet as W import XMonad.Actions.CycleWS -- toggleOrView for people who prefer view to greedyView toggleOrView' = toggleOrDoSkip [] W.view -- toggleOrView ignoring scratchpad and named scratchpad workspace toggleOrViewNoSP = toggleOrDoSkip ["NSP"] W.greedyView </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:skipTags" ><A NAME="v%3AskipTags" ></A ></A ><B >skipTags</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq" >Eq</A > i => [<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-StackSet.html#t%3AWorkspace" >Workspace</A > i l a] -> [i] -> [<A HREF="/usr/share/doc/ghc/html/libraries/xmonad-0.9.1/XMonad-StackSet.html#t%3AWorkspace" >Workspace</A > i l a]</TD ><TD CLASS="declbut" ><A HREF="src/XMonad-Actions-CycleWS.html#skipTags" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >List difference (\\) for workspaces and tags. Removes workspaces matching listed tags from the given workspace list. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.6.1</TD ></TR ></TABLE ></BODY ></HTML >