[xmonad] Using dzen's new ^ca functionality to switch workspaces with left clicks on dzen's statusbar.

Norbert Zeh nzeh at cs.dal.ca
Sat Feb 14 17:07:28 EST 2009

As a quick fix, you could override ppVisible, ppHidden, and
ppHiddenNoWindows in your dynamicLog PP to annotate every workspace with
the necessary ^ca escape sequences.  Something like

ppVisible = f

ws = ["A", "B", "C"]

f s = "^ca(1,ws" ++ (show i) ++ ")" ++ s ++ "^ca()"
    i = fromJust $ elemIndex s ws

For this to work, you need to import Data.List.


On Sat, Feb 14, 2009 at 10:14:36PM +0100, Rasmus Jorgensen wrote:
> Hi XMonad users and devs,
> I have been using XMonad for a year and a half and being a previous dwm user
> I always wanted to have the "left click on ws-tab takes me to ws"
> functionality. First step was to hack together bash script and using several
> small tools to get the wanted functionality. Can be found here if anyones
> interested: http://bbs.archlinux.org/viewtopic.php?id=60665 (It's ugly but
> it works)
> Well, this script has now become redundant with the dzen svn 251 "^ca"
> functionality - checkout dzen 251 with the following command:
> svn checkout http://dzen.googlecode.com/svn/trunk/ dzen
> Putting the following ^ca escape sequences with corresponding scripts in
> your workspace list provides the functionality that I want:
> workspaces        =
> "^ca(1,ws1)abc^ca()":"^ca(1,ws2)def^ca()":"^ca(1,ws3)ghi^ca()":[],
> The ws* scripts contain the following:
> xdotool key <modkey>+<ws-number>
> My ws1 script contains:
> xdotool key alt+1
> Adding dzen escape sequences to the workspace list is not optimal since it
> looks messy and your workspace names does not get recognized by the
> manageHook. Hence
> , className =? "Gran Paradiso"  --> doF (W.shift "abc")
> does not work. One has to put in "doF (W.shift "^ca(1,ws1)abc^ca()")" to get
> it to work. No big problem, but it's not pretty.
> I'm not a very good at programming in general and Haskell is something I'm
> trying to learn the basics of at the moment. So I was thinking if anyone
> would be interested in expanding the Util.Dzen module or write a new module
> to include this functionality, so that (workspace shifting)commands can be
> bound to workspace tabs in the dzen statusbar? Perhaps even without calling
> external scripts.
> If anything of the above needs to be expanded upon please say so.
> I hope I have woken your interest.
> Thanks,
> Rasmus Edgar

> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad


Canada Research Chair
Associate Professor			Email: nzeh at cs.dal.ca
Faculty of Computer Science		Phone: (902) 494-3154
Dalhousie University			Fax:   (902) 492-1517

More information about the xmonad mailing list