Quantcast
Channel: How to start up xmonad with apps on other workspaces - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How to start up xmonad with apps on other workspaces

$
0
0

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:

  1. using spawnOn from XMonad.Actions.SpawnOn, which flat doesn't work (testing with urxvt, and also xclock as a simple example); it gets sent to the current workspace.

  2. 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).

  3. 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.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>