xmonad-contrib-0.18.0: Community-maintained extensions for xmonad
Copyright(c) Brent Yorgey
LicenseBSD-style (see LICENSE)
Maintainer<byorgey@gmail.com>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

XMonad.Layout.PerWorkspace

Contents

Description

Configure layouts on a per-workspace basis: use layouts and apply layout modifiers selectively, depending on the workspace.

Synopsis

Usage

You can use this module by importing it into your xmonad.hs file:

import XMonad.Layout.PerWorkspace

and modifying your layoutHook as follows (for example):

layoutHook = modWorkspace "baz" m1 $  -- apply layout modifier m1 to all layouts on workspace "baz"
             onWorkspace "foo" l1 $  -- layout l1 will be used on workspace "foo".
             onWorkspaces ["bar","6"] l2 $  -- layout l2 will be used on workspaces "bar" and "6".
             l3                      -- layout l3 will be used on all other workspaces.

Note that l1, l2, and l3 can be arbitrarily complicated layouts, e.g. (Full ||| smartBorders $ tabbed shrinkText def ||| ...), and m1 can be any layout modifier, i.e. a function of type (l a -> ModifiedLayout lm l a). (In fact, m1 can be any function (LayoutClass l a, LayoutClass l' a) => l a -> l' a.)

In another scenario, suppose you wanted to have layouts A, B, and C available on all workspaces, except that on workspace foo you want layout D instead of C. You could do that as follows:

layoutHook = A ||| B ||| onWorkspace "foo" D C

data PerWorkspace (l1 :: Type -> Type) (l2 :: Type -> Type) a Source #

Structure for representing a workspace-specific layout along with a layout for all other workspaces. We store the tags of workspaces to be matched, and the two layouts. We save the layout choice in the Bool, to be used to implement description.

Instances

Instances details
(LayoutClass l1 a, LayoutClass l2 a, Show a) => LayoutClass (PerWorkspace l1 l2) a Source # 
Instance details

Defined in XMonad.Layout.PerWorkspace

Methods

runLayout :: Workspace WorkspaceId (PerWorkspace l1 l2 a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (PerWorkspace l1 l2 a)) #

doLayout :: PerWorkspace l1 l2 a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (PerWorkspace l1 l2 a)) #

pureLayout :: PerWorkspace l1 l2 a -> Rectangle -> Stack a -> [(a, Rectangle)] #

emptyLayout :: PerWorkspace l1 l2 a -> Rectangle -> X ([(a, Rectangle)], Maybe (PerWorkspace l1 l2 a)) #

handleMessage :: PerWorkspace l1 l2 a -> SomeMessage -> X (Maybe (PerWorkspace l1 l2 a)) #

pureMessage :: PerWorkspace l1 l2 a -> SomeMessage -> Maybe (PerWorkspace l1 l2 a) #

description :: PerWorkspace l1 l2 a -> String #

(Read (l1 a), Read (l2 a)) => Read (PerWorkspace l1 l2 a) Source # 
Instance details

Defined in XMonad.Layout.PerWorkspace

(Show (l1 a), Show (l2 a)) => Show (PerWorkspace l1 l2 a) Source # 
Instance details

Defined in XMonad.Layout.PerWorkspace

Methods

showsPrec :: Int -> PerWorkspace l1 l2 a -> ShowS #

show :: PerWorkspace l1 l2 a -> String #

showList :: [PerWorkspace l1 l2 a] -> ShowS #

onWorkspace Source #

Arguments

:: (LayoutClass l1 a, LayoutClass l2 a) 
=> WorkspaceId

the tag of the workspace to match

-> l1 a

layout to use on the matched workspace

-> l2 a

layout to use everywhere else

-> PerWorkspace l1 l2 a 

Specify one layout to use on a particular workspace, and another to use on all others. The second layout can be another call to onWorkspace, and so on.

onWorkspaces Source #

Arguments

:: (LayoutClass l1 a, LayoutClass l2 a) 
=> [WorkspaceId]

tags of workspaces to match

-> l1 a

layout to use on matched workspaces

-> l2 a

layout to use everywhere else

-> PerWorkspace l1 l2 a 

Specify one layout to use on a particular set of workspaces, and another to use on all other workspaces.

modWorkspace Source #

Arguments

:: (LayoutClass l1 a, LayoutClass l2 a) 
=> WorkspaceId

tag of the workspace to match

-> (l2 a -> l1 a)

the modifier to apply on the matching workspace

-> l2 a

the base layout

-> PerWorkspace l1 l2 a 

Specify a layout modifier to apply to a particular workspace; layouts on all other workspaces will remain unmodified.

modWorkspaces Source #

Arguments

:: (LayoutClass l1 a, LayoutClass l2 a) 
=> [WorkspaceId]

tags of the workspaces to match

-> (l2 a -> l1 a)

the modifier to apply on the matching workspaces

-> l2 a

the base layout

-> PerWorkspace l1 l2 a 

Specify a layout modifier to apply to a particular set of workspaces; layouts on all other workspaces will remain unmodified.