---------- Forwarded message ----------
From: kevind256
Date: Sat, 11 Dec 2010 13:37:55 +0300
Subject: How to use onScreen function on startup?
To: xmonad@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.