I need the information about the current workspace/screen from Xmonad. I need it externally in a bash script so that I can perform some function based on the current workspace where I am in.
I searched the web and it seems like dynamicLog is one of the way to do this. But am not able to figure out how exactly to send the information from Xmonad into a file. What I am trying to do is that make Xmonad update a certain file with the current workspace information whenever it changes.
Can this be done through DynamicLogger?
My current Xmonad dynamicLog section is as follows:
, logHook = dynamicLogWithPP
xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "darkgreen" "" . shorten 100
}
Alternatively, looking at another method on the web, I tried something like
.
.
.
import XMonad.Hooks.SetWMName
import XMonad.Hooks.EwmhDesktops
import XMonad.Util.Cursor
myStartupHook = do
startupHook gnomeConfig
-- spawn "xcompmgr -cfC -t-9 -l-11 -r9 -D6 &"
setDefaultCursor xC_left_ptr <+> ewmhDesktopsStartup >> setWMName "Xmonad"
.
.
.
...to be used for the utility wmctrl but it did not work. Its output was like -
$ wmctrl -d
Cannot get number of desktops properties. (_NET_NUMBER_OF_DESKTOPS or _WIN_WORKSPACE_COUNT)
Any help on any of the above is appreciated.
Thanks