[xmonad] Fwd: How to use onScreen function on startup?

Adam Vogt vogt.adam at gmail.com
Sun Dec 12 17:32:15 CET 2010


* On Sunday, December 12 2010, kevind256 wrote:

>---------- Forwarded message ----------
>From: kevind256 <kevind256 at gmail.com>
>Date: Sat, 11 Dec 2010 13:37:55 +0300
>Subject: How to use onScreen function on startup?
>To: xmonad at haskell.org
>
>Hi,
>
>Sorry to ask question out of total lack of knowledge of Haskell, but
>how do I use a function (in this case onScreen from
>XMonad.Actions.OnScreen) at xmonad startup? I's like to assign the
>last workspace to second screen by default, since it's really
>secondary in my setup (music player is there usually).
>
>I tried putting this in main = do { ... } section:
>onScreen 1 "9";

First, onScreen manipulates xmonad state so it needs to be run after
that has been created. So put it in the startupHook like:

main = do
    ... 
    main = xmonad defaultConfig {
... -- other stuff
modMask = modm,
startupHook = windows (viewOnScreen 1 "9") }


I've corrected the expression as well, following the 'simpler' example
given in the module documentation.


Adam



More information about the xmonad mailing list