[xmonad] trying to get started w/ xmonad

Brent Yorgey byorgey at seas.upenn.edu
Thu Jan 20 16:06:45 CET 2011


On Wed, Jan 19, 2011 at 09:41:49AM -0500, Sean Allen wrote:
> I'm attempting to ease into using xmonad by using the gnome integration.
> 
> I have a dual monitor setup and I want to turn greedy views off and have
> each screen have its own set of workspaces,
> so if I'm on the main monitor, it has its own workspace 1-9 and the same for
> the second screen.
> 
> starting from various faqs, I came up with this:
> 
> 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
> main = do
>     xmonad $ gnomeConfig {
>             workspaces = withScreens 2 ["1", "2", "3", "4", "5", "6", "7",
> "8", "9"]
>           , modMask = mod4Mask
>           , terminal = "gnome-terminal"
>           , layoutHook  = smartBorders (layoutHook gnomeConfig)
>     } `additionalKeys` myKeys
> 
> 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]
> 
> gnomeConfig is in scope but that doesn't seem to make a difference and it
> kills the rebind for dmenu.
> pointers greatly appreciated.

The intention there is to get the list of workspaces from your
configuration, but it's probably easier just to define your list of
workspaces separately and use it in two places, like so:

  myWorkspaces = map show [1..9]

  main = xmonad $ gnomeConfig {
                    workspaces = withScreens 2 myWorkspaces
                    ...

                      | (i,k) <- zip myWorkspaces [xK_1 .. xK_9]

-Brent



More information about the xmonad mailing list