XMonad.Hooks.WorkspaceHistory

xmonad-contrib-0.18.1: Community-maintained extensions for xmonad

Copyright | (c) 2013 Dmitri Iouchtchenko
License | BSD3-style (see LICENSE)
Maintainer | Dmitri Iouchtchenko <johnnyspoon@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Hooks.WorkspaceHistory

Contents

- Usage
- Querying
- Handling edits

Description

Keeps track of workspace viewing order.

Synopsis

- workspaceHistoryHook :: X ()
- workspaceHistoryHookExclude :: [WorkspaceId] -> X ()
- workspaceHistory :: X [WorkspaceId]
- workspaceHistoryByScreen :: X [(ScreenId, [WorkspaceId])]
- workspaceHistoryWithScreen :: X [(ScreenId, WorkspaceId)]
- workspaceHistoryTransaction :: X () -> X ()
- workspaceHistoryModify :: ([(ScreenId, WorkspaceId)] -> [(ScreenId, WorkspaceId)]) -> X ()

# Usage

To record the order in which you view workspaces, you can use this module with the following in your `xmonad.hs`:

    import XMonad.Hooks.WorkspaceHistory (workspaceHistoryHook)

Then add the hook to your `logHook`:

     main = xmonad $ def
         { ...
         , logHook = ... >> workspaceHistoryHook >> ...
         , ...
         }

If you want to completely exclude certain workspaces from entering the history, you can use `workspaceHistoryHookExclude` instead. For example, to ignore the named scratchpad workspace:

    import XMonad.Util.NamedScratchpad (scratchpadWorkspaceTag)
    ...
    , logHook = ... >> workspaceHistoryHookExclude [scratchpadWorkspaceTag] >> ...

To make use of the collected data, a query function is provided.

workspaceHistoryHook :: X () #

A `logHook` that keeps track of the order in which workspaces have been viewed.

workspaceHistoryHookExclude :: [WorkspaceId] -> X () #

Like `workspaceHistoryHook`, but with the ability to exclude certain workspaces.

# Querying

workspaceHistory :: X [WorkspaceId] #

A list of workspace tags in the order they have been viewed, with the most recent first. No duplicates are present, but not all workspaces are guaranteed to appear, and there may be workspaces that no longer exist.

workspaceHistoryByScreen :: X [(ScreenId, [WorkspaceId])] #

workspaceHistoryWithScreen :: X [(ScreenId, WorkspaceId)] #

# Handling edits

workspaceHistoryTransaction :: X () -> X () #

workspaceHistoryModify :: ([(ScreenId, WorkspaceId)] -> [(ScreenId, WorkspaceId)]) -> X () #

Modify a the workspace history with a given pure function.