[xmonad] trying to get started w/ xmonad

Sean Allen sean at monkeysnatchbanana.com
Thu Jan 20 23:05:08 CET 2011


For the edification of others who come later, I got this working w/ a little
off list help from a list member... plus addressed a couple other issues I
was having and my beginner config now looks like:

import XMonad
import XMonad.Config.Gnome
import XMonad.Layout.NoBorders
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig (additionalKeys)
import XMonad.Layout.IndependentScreens
import XMonad.Actions.UpdatePointer
import XMonad.Hooks.DynamicLog

conf = gnomeConfig {
        workspaces = myWorkspaces
        , modMask = mod4Mask
        , terminal = "gnome-terminal"
        , layoutHook  = smartBorders (layoutHook gnomeConfig)
        , logHook = dynamicLog >> updatePointer (Relative 0.5 0.5)
  } `additionalKeys` myKeys

myWorkspaces = withScreens 2 ["1", "2", "3", "4", "5", "6", "7", "8", "9"]

myKeys =
         [
         -- workspaces are distinct by screen
          ((m .|. mod4Mask, k), windows $ onCurrentScreen f i)
               | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
               , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
         ]
         ++
         [
         -- swap screen order
         ((m .|. mod4Mask, key), screenWorkspace sc >>= flip whenJust
(windows . f))
               | (key, sc) <- zip [xK_w, xK_e, xK_r] [1,0,2]
               , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
         ++
         [
          -- rebind meta-p to dmenu
          ((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval \"exec
$exe\"")
         ]

main = xmonad conf


On Thu, Jan 20, 2011 at 12:44 PM, Daniel Schoepe <
daniel.schoepe at googlemail.com> wrote:

> Excerpts from Sean Allen's message of Wed Jan 19 15:41:49 +0100 2011:
> > myKeys = [
> >           -- rebind meta-p to dmenu
> >           ((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval
> \"exec
> > $exe\"")
> >          ]
> >          ++
> >          [
> >           ((m .|. mod4Mask, k), windows $ onCurrentScreen f i)
> >                | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
> >                , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
> >          ]
> >
> > but conf on this line isn't in scope:
> >
> >                | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
>
> myKeys is given the config as an argument, which the author of the
> code that causes the error assumed to be named conf. So you'd have
> to write:
>
> myKeys conf = ..
>
> Regards,
> Daniel
>
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20110120/e2d55132/attachment-0001.htm>


More information about the xmonad mailing list