Clickable Workspaces in XMonad with Dzen2

One feature DWM has which is missing in XMonad is the clickable workspaces in status bar. There is a very good reason for this, which is that statusbars in XMonad are external applications i.e. XMobar and Dzen2.

To achieve clickable workspaces in XMonad with Dzen2 the following is needed:

  1. dzen2 (the latest SVN chekout which includes the ^ca functionality)
  2. XMonad
  3. xdotool

Include these modules in your xmonad.hs:

import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import Data.List

Comment out your current workspace listing and enter following instead:

myWorkspaces            :: [String]
myWorkspaces            = clickable . (map dzenEscape) $ ["1","2","3","4","5"]
 
  where clickable l     = [ "^ca(1,xdotool key alt+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
                            (i,ws) <- zip [1..] l,
                            let n = i ]

If you have any redirects in your ManageHook change them accordingly:

, className =? "Firefox"  --> doF (W.shift (myWorkspaces !! 1))

If this does not work report back here: edgar <at> archlinux dot us

Reference: McManiac @ http://bbs.archlinux.org/viewtopic.php?id=40637&p=8

 
clickable_workspaces.txt · Last modified: 2010/04/05 16:11 by ashren
[unknown button type]
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Driven by DokuWiki