XMonad.Util.ClickableWorkspaces

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

Copyright | (c) Geoff deRosenroll <geoffderosenroll@gmail.com>
License | BSD3-style (see LICENSE)
Maintainer | Geoff deRosenroll <geoffderosenroll@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Util.ClickableWorkspaces

Contents

- Usage

Description

Provides `clickablePP`, which when applied to the `PP` pretty-printer used by XMonad.Hooks.StatusBar will make the workspace tags clickable in XMobar (for switching focus).

Synopsis

- clickablePP :: PP -> X PP
- clickableWrap :: Int -> String -> String

# Usage

If you're using the XMonad.Hooks.StatusBar interface, apply `clickablePP` to the `PP` passed to `statusBarProp`:

    mySB <- statusBarProp "xmobar" (clickablePP xmobarPP)

Or if you're using the old XMonad.Hooks.DynamicLog interface:

    logHook = clickablePP xmobarPP { ... } >>= dynamicLogWithPP

Requirements:

- `xdotool` on system (in path)
- XMonad.Hooks.EwmhDesktops for `xdotool` support (see Hackage docs for setup)
- use of UnsafeStdinReader/UnsafeXMonadLog in xmobarrc (rather than StdinReader/XMonadLog)

Note that UnsafeStdinReader is potentially dangerous if your workspace names are dynamically generated from untrusted input (like window titles). You may need to add `xmobarRaw` to `ppRename` before applying `clickablePP` in such case.

clickablePP :: PP -> X PP #

Apply clickable wrapping to the given PP.

clickableWrap :: Int -> String -> String #

Wrap string with an xmobar action that uses `xdotool` to switch to workspace `i`.