You are not logged in.

#1 2011-06-29 06:38:41

iimblack
Member
Registered: 2011-03-04
Posts: 16

xmonad.hs errors

Been working on a new XMonad setup and got a few errors I can't figure out.
I'm sure I've made some very basic and nooby mistakes but I honestly can't figure out what I'm doing wrong.

xmonad.hs:39:5:
    No instance for (Read (l0 Window))
      arising from a use of `xmonad'
    Possible fix: add an instance declaration for (Read (l0 Window))
    In the expression: xmonad
    In the expression:
        xmonad
      $   withUrgencyHook NoUrgencyHook
        $ defaultConfig
            {terminal = myTerminal, modMask = myModMask,
             focusFollowsMouse = False, workspaces = myWorkspaces,
             normalBorderColor = myNormalBorderColor,
             focusedBorderColor = myFocusedBorderColor, keys = myKeys,
             layoutHook = myLayoutHook, manageHook = myManageHook,
             logHook = myLogHook xmproc}
    In the expression:
      do { xmproc <- spawnPipe "xmobar";
             xmonad
           $   withUrgencyHook NoUrgencyHook
             $ defaultConfig
                 {terminal = myTerminal, modMask = myModMask,
                  focusFollowsMouse = False, workspaces = myWorkspaces,
                  normalBorderColor = myNormalBorderColor,
                  focusedBorderColor = myFocusedBorderColor, keys = myKeys,
                  layoutHook = myLayoutHook, manageHook = myManageHook,
                  logHook = myLogHook xmproc} }

xmonad.hs:39:14:
    No instance for (LayoutClass l0 Window)
      arising from a use of `withUrgencyHook'
    Possible fix:
      add an instance declaration for (LayoutClass l0 Window)
    In the expression: withUrgencyHook NoUrgencyHook
    In the second argument of `($)', namely
      `withUrgencyHook NoUrgencyHook
     $ defaultConfig
         {terminal = myTerminal, modMask = myModMask,
          focusFollowsMouse = False, workspaces = myWorkspaces,
          normalBorderColor = myNormalBorderColor,
          focusedBorderColor = myFocusedBorderColor, keys = myKeys,
          layoutHook = myLayoutHook, manageHook = myManageHook,
          logHook = myLogHook xmproc}'
    In the expression:
        xmonad
      $   withUrgencyHook NoUrgencyHook
        $ defaultConfig
            {terminal = myTerminal, modMask = myModMask,
             focusFollowsMouse = False, workspaces = myWorkspaces,
             normalBorderColor = myNormalBorderColor,
             focusedBorderColor = myFocusedBorderColor, keys = myKeys,
             layoutHook = myLayoutHook, manageHook = myManageHook,
             logHook = myLogHook xmproc}

xmonad.hs:62:75:
    Couldn't match expected type `Rational -> Rational -> Tall a0'
                with actual type `GHC.Word.Word64'
    Expected type: XMonad.Layout.LayoutModifier.ModifiedLayout
                     (XMonad.Layout.Decoration.Decoration
                        TabbedDecoration XMonad.Layout.Decoration.DefaultShrinker)
                     XMonad.Layout.Simplest.Simplest
                     (Rational -> Rational -> Tall a0)
      Actual type: XMonad.Layout.LayoutModifier.ModifiedLayout
                     (XMonad.Layout.Decoration.Decoration
                        TabbedDecoration XMonad.Layout.Decoration.DefaultShrinker)
                     XMonad.Layout.Simplest.Simplest
                     Window
    In the first argument of `(|||)', namely `simpleTabbed'
    In the second argument of `(|||)', namely `simpleTabbed ||| Full'

xmonad.hs:123:25:
    Couldn't match expected type `X ()'
                with actual type `XPConfig -> X ()'
    In the expression: shellPrompt
    In the expression: ((modMask, xK_p), shellPrompt)
    In the first argument of `(++)', namely
      `[((modMask, xK_Return), spawn $ terminal conf),
        ((modMask, xK_z), kill), ((modMask, xK_p), shellPrompt),
        ((modMask, xK_space), sendMessage NextLayout), ....]'

Here's the pastebin of my xmonad.hs
http://pastebin.com/4hsPvipc

Any help is greatly appreciated.

Offline

#2 2011-06-29 12:49:24

kofrad
Member
From: South Florida, USA
Registered: 2011-05-15
Posts: 45

Re: xmonad.hs errors

I personally had a few similar issues configuring my xmonad.hs because I didn't really take the time to learn haskell, I still haven't, but I kind of figured it out piecing tutorials/others code together.

The main issue seems to be coming from the main block between lines 32-51. I think it's just syntax/formatting errors. For mine to work it had to be in the bottom of the file, as well as slightly different in terms of layout. I'll post my xmonad.hs so you can take a look for yourself. I'd start by messing with the main block, I have a feeling the other errors will go away after you fix that.

http://pastebin.com/SgkhS9ck


Desktop: Arch Linux | AMD Athlon 64 X2 Dual Core 5000+ | 3GB RAM | GeForce 6800 XT 512MB | 1TB+
Audio Studio: XP SP3 | Intel Pentium 4 3GHz Prescott | 1GB DDR | GeForce 6800 128MB | 120GB

Offline

#3 2011-07-02 14:56:41

listdata
Member
Registered: 2008-12-23
Posts: 102
Website

Re: xmonad.hs errors

Hi iimblack,

Looks like you got a horribly botched configuration from the web... Your config is very advanced --- you should try out the default, minimal config and add 1 feature at a time. Trying to add all the bells and whistles at once is a bad idea.

Anyway, here are some of the error messages in plain English:

@34:5 and @34:14: both of these errors go away once you fix the "Tall" function @57

@57: the "Tall" function needs 3 more arguments; here's mine just to compare:

myLayout = Mirror tiled
        ||| tiled
        ||| noBorders Full
        ||| layoutHints Circle
    where
        -- default tiling algorithm partitions the screen into two panes
        tiled   = Tall nmaster delta ratio -- see how there's 3 arguments to "Tall"
        -- The default number of windows in the master pane
        nmaster = 1
        -- Default proportion of screen occupied by master pane
        ratio   = 1/2
        -- Percent of screen to increment by when resizing panes
        delta   = 3/100

@118: the shellPrompt function needs an argument of type "XPConfig" --- I googled "xpconfig xmonad" for you and very quickly found http://xmonad.org/xmonad-docs/xmonad-co … Shell.html which tells you exactly what you need to know:

2. In your keybindings add something like:

   , ((modm .|. controlMask, xK_x), shellPrompt defaultXPConfig)

@122: (this error will come up after you fix the one @118): similarly, you need to provide a config here again (albeit not XPConfig), as follows:

    , ((modMask, xK_s), scratchpadSpawnAction defaultConfig {terminal = "urxvt"})

You also have a ton of errors here:

    -- ncmpcpp
    , ((), spawn "ncmpcpp prev")
    , ((), spawn "ncmpcpp next")
    , ((), spawn "ncmpcpp toggle")
    -- Volume
    , ((), spawn "amixer -q set Master 2dB+ unmute")
    , ((), spawn "amixer -q set Master 2dB- unmute")
    , ((), spawn "amixer -q set Master toggle")

Looks like you deleted all of the keybindings for these and forgot to fill them in again with your own.

And those are all of your errors. It compiles here on my machine just fine after fixing them...

Last edited by listdata (2011-07-02 15:23:50)

Offline

Board footer

Powered by FluxBB