I'm trying to write an xmonad.hs which, at startup, launches some apps on some workspaces. Several of these apps (e.g., atop) will run within a terminal (urxvt being my preference).
This has been asked a few times before, e.g, here, here, and is obliquely touched on on the XMonad FAQ.
However, these rely on:
using
spawnOnfromXMonad.Actions.SpawnOn, which flat doesn't work (testing withurxvt, and alsoxclockas a simple example); it gets sent to the current workspace.using
spawn prog >> windows $ greedyView <workspace>, which kinda works, but has major timing issues - e.g., if you run two in succession, with different workspaces, both progs end up on the latter workspace. FWIW, I experimented with using threaddelay to assist; it didn't make any discernable difference, even with a 10s delay between spawns (I remembered that threadDelay is in microseconds, and so used 10000000).rely on using general hooks for programs - meaning that whenever I start them up, they'll get sent to the given workspace. That's not what I want; I just want them placed there at startup.
Relatedly, it surprises me that the API doesn't let me start up an app and then give me a reference to that app/window (potentially with a timeout); so that I can confidently send that app/window to a workspace.
Any help would be greatly appreciated.