xmonad-contrib-0.13: Third party extensions for xmonad

Copyright(c) Roman Cheplyaka
LicenseBSD-style (see LICENSE)
MaintainerRoman Cheplyaka <roma@ro-che.info>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98

XMonad.Layout.Monitor

Contents

Description

Layout modifier for displaying some window (monitor) above other windows.

Synopsis

Usage

You can use this module with the following in your ~/.xmonad/xmonad.hs:

import XMonad.Layout.Monitor

Define Monitor record. monitor can be used as a template. At least prop and rect should be set here. Also consider setting persistent to True.

Minimal example:

myMonitor = monitor
    { prop = ClassName "SomeClass"
    , rect = Rectangle 0 0 40 20 -- rectangle 40x20 in upper left corner
    }

More interesting example:

clock = monitor {
     -- Cairo-clock creates 2 windows with the same classname, thus also using title
     prop = ClassName "Cairo-clock" `And` Title "MacSlow's Cairo-Clock"
     -- rectangle 150x150 in lower right corner, assuming 1280x800 resolution
   , rect = Rectangle (1280-150) (800-150) 150 150
     -- avoid flickering
   , persistent = True
     -- make the window transparent
   , opacity = 0.6
     -- hide on start
   , visible = False
     -- assign it a name to be able to toggle it independently of others
   , name = "clock"
   }

Add ManageHook to de-manage monitor windows and apply opacity settings.

manageHook = myManageHook <+> manageMonitor clock

Apply layout modifier.

myLayout = ModifiedLayout clock $ tall ||| Full ||| ...

After that, if there exists a window with specified properties, it will be displayed on top of all tiled (not floated) windows on specified position.

It's also useful to add some keybinding to toggle monitor visibility:

, ((mod1Mask, xK_u     ), broadcastMessage ToggleMonitor >> refresh)

Screenshot: http://www.haskell.org/haskellwiki/Image:Xmonad-clock.png

Hints and issues

  • This module assumes that there is only one window satisfying property exists.
  • If your monitor is available on all layouts, set persistent to True to avoid unnecessary flickering. You can still toggle monitor with a keybinding.
  • You can use several monitors with nested modifiers. Give them names

data Monitor a Source #

Constructors

Monitor 

Fields

Instances

LayoutModifier Monitor Window Source # 

Methods

modifyLayout :: LayoutClass l Window => Monitor Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (l Window)) Source #

modifyLayoutWithUpdate :: LayoutClass l Window => Monitor Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (Monitor Window)) Source #

handleMess :: Monitor Window -> SomeMessage -> X (Maybe (Monitor Window)) Source #

handleMessOrMaybeModifyIt :: Monitor Window -> SomeMessage -> X (Maybe (Either (Monitor Window) SomeMessage)) Source #

pureMess :: Monitor Window -> SomeMessage -> Maybe (Monitor Window) Source #

redoLayout :: Monitor Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (Monitor Window)) Source #

pureModifier :: Monitor Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (Monitor Window)) Source #

hook :: Monitor Window -> X () Source #

unhook :: Monitor Window -> X () Source #

modifierDescription :: Monitor Window -> String Source #

modifyDescription :: LayoutClass l Window => Monitor Window -> l Window -> String Source #

Read (Monitor a) Source # 
Show (Monitor a) Source # 

Methods

showsPrec :: Int -> Monitor a -> ShowS #

show :: Monitor a -> String #

showList :: [Monitor a] -> ShowS #

monitor :: Monitor a Source #

Template for Monitor record. At least prop and rect should be redefined. Default settings: visible is True, persistent is False.

data Property Source #

Most of the property constructors are quite self-explaining.

Constructors

Title String 
ClassName String 
Resource String 
Role String

WM_WINDOW_ROLE property

Machine String

WM_CLIENT_MACHINE property

And Property Property infixr 9 
Or Property Property infixr 8 
Not Property 
Const Bool 

doHideIgnore :: ManageHook Source #

Hides window and ignores it.

manageMonitor :: Monitor a -> ManageHook Source #

ManageHook which demanages monitor window and applies opacity settings.

TODO

  • make Monitor remember the window it manages
  • specify position relative to the screen