I want to get the currently active tag in xmonad as a string. I've imported the stackset with

import qualified XMonad.StackSet as W

I can get get the tag of the currently focused workspace with W.currentTag, but it's type is StackSet i0 l0 a0 s0 sd0 -> i0

How do I convert this to a string?


i is of type http://hackage.haskell.org/package/xmonad-0.15/docs/XMonad-Core.html#t:WindowSet which is a type alias for String.

currentTag will evaluate to String if you give it a parameter relating to StackSet.

http://hackage.haskell.org/package/xmonad-0.15/docs/XMonad-Core.html#v:withWindowSet is what you could use.

So I think you can do: withWindowSet (pure . currentTag) this is an expression of type X String

It's also available here: https://hackage.haskell.org/package/xmonad-contrib-0.15/docs/XMonad-Util-Loggers.html#v:logCurrent

import XMonad.Util.Loggers
logCurrent :: X (Maybe String)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.