xmonad-contrib-0.17.0.9: Community-maintained extensions for xmonad
Copyright(c) Karsten Schoelzel <kuser@gmx.de>
LicenseBSD
MaintainerKarsten Schoelzel <kuser@gmx.de>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

XMonad.Hooks.XPropManage

Contents

Description

A ManageHook matching on XProperties.

Synopsis

Usage

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

import XMonad.Hooks.XPropManage
import qualified XMonad.StackSet as W
import XMonad.Actions.TagWindows
import Data.List
manageHook = xPropManageHook xPropMatches

xPropMatches :: [XPropMatch]
xPropMatches = [ ([ (wM_CLASS, any ("gimp"==))], (\w -> float w >> return (W.shift "2")))
               , ([ (wM_COMMAND, any ("screen" ==)), (wM_CLASS, any ("xterm" ==))], pmX (addTag "screen"))
               , ([ (wM_NAME, any ("Iceweasel" `isInfixOf`))], pmP (W.shift "3"))
               ]

Properties known to work: wM_CLASS, wM_NAME, wM_COMMAND

A XPropMatch consists of a list of conditions and function telling what to do.

The list entries are pairs of an XProperty to match on (like wM_CLASS, wM_NAME)^1, and an function which matches onto the value of the property (represented as a List of Strings).

If a match succeeds the function is called immediately, can perform any action and then return a function to apply in windows (see Operations.hs). So if the action does only work on the WindowSet use just 'pmP function'.

*1 You can get the available properties of an application with the xprop utility. STRING properties should work fine. Others might not work.

pmX :: (Window -> X ()) -> Window -> X (WindowSet -> WindowSet) Source #