You are not logged in.

#1 2016-01-29 05:24:26

rabcor
Banned
Registered: 2013-02-09
Posts: 500

[Solved] Xmonad unable to load extensions

For some reasons my xmonad can't load the extensions used in my xmonad.hs config file.

This is the error:

xmonad.hs:2:8:
    Could not find module ‘XMonad.Hooks.DynamicLog’
    Use -v to see a list of the files searched for.

xmonad.hs:3:8:
    Could not find module ‘XMonad.Hooks.ManageDocks’
    Use -v to see a list of the files searched for.

xmonad.hs:4:8:
    Could not find module ‘XMonad.Util.Run’
    Use -v to see a list of the files searched for.

xmonad.hs:5:8:
    Could not find module ‘XMonad.Util.EZConfig’
    Use -v to see a list of the files searched for.

xmonad.hs:6:8:
    Could not find module ‘XMonad.Layout.NoBorders’
    Use -v to see a list of the files searched for.

xmonad.hs:8:8:
    Could not find module ‘XMonad.Config.Desktop’
    Use -v to see a list of the files searched for.

My xmonad.hs

Last edited by rabcor (2016-01-30 18:22:26)

Offline

#2 2016-01-29 09:05:35

gansteed
Member
Registered: 2015-03-07
Posts: 4

Re: [Solved] Xmonad unable to load extensions

maybe you should try:

    sudo pacman -S xmonad-contrib

Offline

#3 2016-01-29 11:29:17

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: [Solved] Xmonad unable to load extensions

I have that package installed, it doesn't seem to have helped. The imports listed are practically all the imported libs except for the base xmonad lib.

Update:
I tried compiling xmonad-git packages from aur, and confirmed that the extensions that are not loading are part of the xmonad-contrib package, I have it installed so as for why they aren't working, I can't say. The git version is not giving me any more luck even if it is successfully compiling.

Last edited by rabcor (2016-01-29 14:45:55)

Offline

#4 2016-01-30 09:58:41

kpbochenek
Member
Registered: 2015-03-08
Posts: 14

Re: [Solved] Xmonad unable to load extensions

I have had similar issues when I mixed installing xmonad via cabal and pacman.
Are you consistent and did you install everything via pacman?

i.e. I have:

> which xmonad
/home/kpbochenek/.cabal/bin/xmonad

And I needed to install xmonad-contrib via cabal.
Do you also have cabal installed? ".cabal" directory in your home?

Offline

#5 2016-01-30 13:04:04

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: [Solved] Xmonad unable to load extensions

Nope I do not have cabal installed, nor a .cabal directory. The only related package I have is ghc. I installed everything with pacman.

Last edited by rabcor (2016-01-30 13:04:38)

Offline

#6 2016-01-30 13:15:54

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] Xmonad unable to load extensions

You should post your xmonad.hs

I'm using DynamicLog, NoBorders & Desktop in mine with no problems (see sig).


Jin, Jîyan, Azadî

Offline

#7 2016-01-30 13:52:00

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: [Solved] Xmonad unable to load extensions

Here is my xmonad.hs (The length is primarily because I copied the complete keybind settings from the example file; everything below the "myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $" line is of little consequence)

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Layout.NoBorders
import System.IO
import XMonad.Config.Desktop

defaultConfig = desktopConfig
    {
             modMask = mod4Mask     -- Rebind Mod to the Windows key
    }

main = do
    xmproc <- spawnPipe "xmobar"

    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , layoutHook = avoidStruts  $  noBorders $  layoutHook defaultConfig
        , logHook = dynamicLogWithPP xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "green" "" . shorten 50
                        }
        , focusedBorderColor = "#000000"
        } myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
 
    -- launch a terminal
    [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
 
    -- launch dmenu
    , ((modm,               xK_p     ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
 
    -- launch gmrun
    , ((modm .|. shiftMask, xK_p     ), spawn "gmrun")
 
    -- close focused window
    , ((modMask .|. shiftMask, xK_F4     ), kill)
 
     -- Rotate through the available layout algorithms
    , ((modm,               xK_space ), sendMessage NextLayout)
 
    --  Reset the layouts on the current workspace to default
    , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
 
    -- Resize viewed windows to the correct size
    , ((modm,               xK_n     ), refresh)
 
    -- Move focus to the next window
    , ((modm,               xK_Tab   ), windows W.focusDown)
 
    -- Move focus to the next window
    , ((modm,               xK_j     ), windows W.focusDown)
 
    -- Move focus to the previous window
    , ((modm,               xK_k     ), windows W.focusUp  )
 
    -- Move focus to the master window
    , ((modm,               xK_m     ), windows W.focusMaster  )
 
    -- Swap the focused window and the master window
    , ((modm,               xK_Return), windows W.swapMaster)
 
    -- Swap the focused window with the next window
    , ((modm .|. shiftMask, xK_j     ), windows W.swapDown  )
 
    -- Swap the focused window with the previous window
    , ((modm .|. shiftMask, xK_k     ), windows W.swapUp    )
 
    -- Shrink the master area
    , ((modm,               xK_h     ), sendMessage Shrink)
 
    -- Expand the master area
    , ((modm,               xK_l     ), sendMessage Expand)
 
    -- Push window back into tiling
    , ((modm,               xK_t     ), withFocused $ windows . W.sink)
 
    -- Increment the number of windows in the master area
    , ((modm              , xK_comma ), sendMessage (IncMasterN 1))
 
    -- Deincrement the number of windows in the master area
    , ((modm              , xK_period), sendMessage (IncMasterN (-1)))
 
    -- Toggle the status bar gap
    -- Use this binding with avoidStruts from Hooks.ManageDocks.
    -- See also the statusBar function from Hooks.DynamicLog.
    --
    -- , ((modm              , xK_b     ), sendMessage ToggleStruts)
 
    -- Quit xmonad
    , ((modm .|. shiftMask, xK_q     ), io (exitWith ExitSuccess))
 
    -- Restart xmonad
    , ((modm              , xK_q     ), spawn "xmonad --recompile; xmonad --restart")
    ]
    ++
 
    --
    -- mod-[1..9], Switch to workspace N
    --
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    --
    [((m .|. modm, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
    ++
 
    --
    -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
    -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
    --
    [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
 
 
------------------------------------------------------------------------
-- Mouse bindings: default actions bound to mouse events
--
myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
 
    -- mod-button1, Set the window to floating mode and move by dragging
    [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
                                       >> windows W.shiftMaster))
 
    -- mod-button2, Raise the window to the top of the stack
    , ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
 
    -- mod-button3, Set the window to floating mode and resize by dragging
    , ((modm, button3), (\w -> focus w >> mouseResizeWindow w
                                       >> windows W.shiftMaster))
 
    -- you may also bind events to the mouse scroll wheel (button4 and button5)
    ]

Man arch has been disagreeable this past month, couldn't get enlightenment to work, not xmonad, X crashes and freezes frequently on gnome, audacious stopped working properly after I uninstalled pulseaudio (which gnome pulled in with it), I've never had as many problems with arch as I do right this moment sad  and just when I needed it to work too. But considering arch's nature, maybe it's about time I start dual booting it with another more stable distro, or just gentoo.

Last edited by rabcor (2016-01-30 17:01:01)

Offline

#8 2016-01-30 17:40:53

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] Xmonad unable to load extensions

My Haskel skills are non-existent so you will have to wait for somebody else to comment on that.

Meanwhile, are there any error messages if you run:

xmonad --recompile

EDIT: Or is that the output you have already posted?

The posted errors suggest trying "-v", did you do that?

Last edited by Head_on_a_Stick (2016-01-30 17:42:34)


Jin, Jîyan, Azadî

Offline

#9 2016-01-30 17:52:48

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: [Solved] Xmonad unable to load extensions

No I did not post that, did not even know that command.

Here is the output

$ xmonad --recompile
Error detected while loading xmonad configuration file: /home/cestarian/.xmonad/xmonad.hs

xmonad.hs:26:57: parse error on input ‘=’

Please check the file for errors.

xmonad: xmessage: executeFile: does not exist (No such file or directory)

(The file referred to is probably the error log I posted in the OP)

Last edited by rabcor (2016-01-30 17:54:15)

Offline

#10 2016-01-30 18:10:33

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] Xmonad unable to load extensions

rabcor wrote:
xmonad.hs:26:57: parse error on input ‘=’

I'm not using EZConfig but my keys line is different:
https://github.com/Head-on-a-Stick/conf … nad.hs#L34

I don't think this is related to your extensions issues though hmm

The only problem with copy&pasting from the default configuration file is that the default file changes when xmonad is updated -- this bit me recently after I spent some time in OpenBSD then came back to Arch and had to re-jig my configuration files to get things working again.

Check the current default file to see what has changed.

As you seem to be having lots of strange problems, can we rule out some sort of hardware problem?

Is your drive health good?

The error output with "-v" passed would be useful to see which files are being searched for.

Just to be absolutley sure, can we see the output of:

pacman -Q xmonad xmonad-contrib

Jin, Jîyan, Azadî

Offline

#11 2016-01-30 18:13:48

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [Solved] Xmonad unable to load extensions

rabcor wrote:

Here is my xmonad.hs (The length is primarily because I copied the complete keybind settings from the example file; everything below the "myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $" line is of little consequence)

Like myMouseBindings, myKeys should be a top-level function definition. Neither of those is used in your config (and in that way "of little consequence"), but right now the start of myKeys' definition becomes part of main's definition, resulting in the parse error.

That does not explain the import errors, though. Where did you get those from? Some outdated log? Let's see what you get after fixing the parse error.

Offline

#12 2016-01-30 18:22:13

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: [Solved] Xmonad unable to load extensions

Oh great, I figured out the syntax of my config file was broken, I decided to compare it to something similar from the xmonad archive (I had followed a tutorial to generate it)

This is what I had originally (and did not work):

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Layout.NoBorders
import System.IO
import XMonad.Config.Desktop

main = do
    xmproc <- spawnPipe "xmobar"

    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , layoutHook = avoidStruts  $  noBorders $  layoutHook defaultConfig
        , logHook = dynamicLogWithPP xmobarPP
                        { ppOutput = hPutStrLn xmproc
                        , ppTitle = xmobarColor "green" "" . shorten 50
                        }
        , focusedBorderColor = "#000000"
        , modMask = mod4Mask     -- Rebind Mod to the Windows key
        }

This is what I have now (and works):

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
import XMonad.Layout.Gaps
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
 
main = do
  xmproc <- spawnPipe "/usr/bin/xmobar"
  xmonad defaultConfig {
    modMask = mod4Mask, 
    terminal = "terminator",
    manageHook = manageDocks <+> manageHook defaultConfig,
    layoutHook = avoidStruts $ noBorders $ layoutHook defaultConfig,
    logHook = dynamicLogWithPP $ xmobarPP
                        { ppOutput = hPutStrLn xmproc,
                          ppTitle = xmobarColor "green" "" . shorten 50
                        }
  } 

The differences are mostly just syntax, but I notice now that both are working (so both syntaxes are correct).

I'm guessing that what happened was that what I really needed was the xmonad-contrib package to get things working properly, however as a first time user I had no idea about that and thought there was something wrong with the config files (until I found that error I posted in the OP, and thought files were missing) at which point I had already messed around a bit with the config file and put in a lot of things with copy-paste work that seemed like they would work (and the errors weren't changing) so I installed xmonad-contrib, and it still wasn't working, and I posted it here and this is that result.

In other words, Thanks Head_on_a_Stick! I never would have solved this without you pointing me towards the xmonad-recompile command (the only command I found when looking for how to test settings was the keyboard shortcut Mod+Q, which obviously wasn't gonna give me terminal outputs)

Last edited by rabcor (2016-01-30 18:23:23)

Offline

Board footer

Powered by FluxBB