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

kevind256 kevind256 at gmail.com
Sun Dec 12 07:34:46 CET 2010


---------- 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";

but got this long error message (till end of this post):
Error detected while loading xmonad configuration file:
/home/kevin/.xmonad/xmonad.hs

xmonad.hs:30:1:
    Couldn't match expected type `IO a'
           against inferred type `i
                                  -> XMonad.StackSet.StackSet i l a1 [Char] sd
                                  -> XMonad.StackSet.StackSet i l a1 [Char] sd'
    In a stmt of a 'do' expression: onScreen 1 "9"
    In the expression:
        do { xmproc <- spawnPipe "xmobar";
             onScreen 1 "9";
               xmonad
             $   defaultConfig
                   {normalBorderColor = "black", focusedBorderColor = "red2",
                    borderWidth = 2, modMask = modm, focusFollowsMouse = False,
                    manageHook = manageDocks <+> manageHook defaultConfig,
                    layoutHook = avoidStruts $ simpleTabbed ||| Tall 1
5.0e-2 0.5,
                    logHook = dynamicLogWithPP
                            $ xmobarPP
                                {ppOutput = hPutStrLn xmproc,
                                 ppTitle = xmobarColor "white" "" .
shorten 100}}
               `additionalKeys`
                 [((modm, xK_a), spawn "aumix -v-2"),
                  ((modm, xK_f), spawn "aumix -v+2"), ....] }
    In the definition of `main':
        main = do { xmproc <- spawnPipe "xmobar";
                    onScreen 1 "9";
                      xmonad
                    $   defaultConfig
                          {normalBorderColor = "black",
focusedBorderColor = "red2",
                           borderWidth = 2, modMask = modm,
focusFollowsMouse = False,
                           manageHook = manageDocks <+> manageHook
defaultConfig,
                           layoutHook = avoidStruts $ simpleTabbed |||
Tall 1 5.0e-2 0.5,
                           logHook = dynamicLogWithPP
                                   $ xmobarPP
                                       {ppOutput = hPutStrLn xmproc,
                                        ppTitle = xmobarColor "white"
"" . shorten 100}}
                      `additionalKeys`
                        [((modm, xK_a), spawn "aumix -v-2"), ....] }

Please check the file for errors.



More information about the xmonad mailing list