xmonad-contrib-0.6: Third party extensions for xmonadSource codeContentsIndex
XMonad.Hooks.UrgencyHook
Portabilityunportable
Stabilityunstable
MaintainerDevin Mullins <me@twifkak.com>
Contents
Usage
Description
UrgencyHook lets you configure an action to occur when a window demands your attention. (In traditional WMs, this takes the form of "flashing" on your "taskbar." Blech.)
Synopsis
withUrgencyHook :: (LayoutClass l Window, UrgencyHook h Window) => h -> XConfig l -> XConfig (ModifiedLayout (WithUrgencyHook h) l)
focusUrgent :: X ()
readUrgents :: X [Window]
withUrgents :: ([Window] -> X a) -> X a
urgencyLayoutHook :: (UrgencyHook h Window, LayoutClass l Window) => h -> l Window -> ModifiedLayout (WithUrgencyHook h) l Window
data NoUrgencyHook = NoUrgencyHook
data StdoutUrgencyHook = StdoutUrgencyHook
dzenUrgencyHook :: DzenUrgencyHook
data DzenUrgencyHook = DzenUrgencyHook {
duration :: Int
args :: [String]
}
class (Read h, Show h) => UrgencyHook h a where
urgencyHook :: h -> a -> X ()
seconds :: Rational -> Int
Usage

To wire this up, first add:

 import XMonad.Hooks.UrgencyHook

to your import list in your config file. Now, choose an urgency hook. If you're just interested in displaying the urgency state in your custom logHook, then choose NoUrgencyHook. Otherwise, you may use the provided dzenUrgencyHook, or write your own.

Enable your urgency hook by wrapping your config record in a call to withUrgencyHook. For example:

 main = xmonad $ withUrgencyHook dzenUrgencyHook { args = ["-bg", "darkgreen", "-xs", "1"] }
               $ defaultConfig

If you want to modify your logHook to print out information about urgent windows, the functions readUrgents and withUrgents are there to help you with that. No example for you.

withUrgencyHook :: (LayoutClass l Window, UrgencyHook h Window) => h -> XConfig l -> XConfig (ModifiedLayout (WithUrgencyHook h) l)Source
This is the preferred method of enabling an urgency hook. It will prepend an action to your logHook that removes visible windows from the list of urgent windows. If you don't like that behavior, you may use urgencyLayoutHook instead.
focusUrgent :: X ()Source

Focuses the most recently urgent window. Good for what ails ya -- I mean, your keybindings. Example keybinding:

 , ((modMask              , xK_BackSpace), focusUrgent)
readUrgents :: X [Window]Source
X action that returns a list of currently urgent windows. You might use it, or withUrgents, in your custom logHook, to display the workspaces that contain urgent windows.
withUrgents :: ([Window] -> X a) -> X aSource
An HOF version of readUrgents, for those who prefer that sort of thing.
urgencyLayoutHook :: (UrgencyHook h Window, LayoutClass l Window) => h -> l Window -> ModifiedLayout (WithUrgencyHook h) l WindowSource
data NoUrgencyHook Source
Constructors
NoUrgencyHook
show/hide Instances
data StdoutUrgencyHook Source
Constructors
StdoutUrgencyHook
show/hide Instances
dzenUrgencyHook :: DzenUrgencyHookSource
Flashes when a window requests your attention and you can't see it. Configurable duration and args to dzen.
data DzenUrgencyHook Source
Constructors
DzenUrgencyHook
duration :: Int
args :: [String]
show/hide Instances
class (Read h, Show h) => UrgencyHook h a whereSource
The class definition, and some pre-defined instances.
Methods
urgencyHook :: h -> a -> X ()Source
show/hide Instances
seconds :: Rational -> IntSource

Multiplies by ONE MILLION, for use with runProcessWithInputAndWait.

Use like:

 (5.5 `seconds`)
Produced by Haddock version 2.3.0