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 = 0xAAAAAAAA
-- 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.
myLayouts = 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
|