Understanding how to build and run xmonad

I've been using xmonad for over a year and I love it, but I am deathly afraid of editing my configuration or upgrading to new versions because I find it a deeply confusing and error-prone experience. I would love to understand it all a bit more so that I am better able to make proper use of xmonad and to benefit from all the good work people are doing on it. My latest trauma comes after getting exasperated with no full-screen in Google Chrome. Reading a page on the bug-tracker[1] led me to guess that the problem might be fixed if I upgraded to a more recent version of xmonad. Unfortunately, I could not remember how I originally installed xmonad - was it via apt-get, cabal or by fetching the source from darcs and building it by hand? Do some or all of these result in the same thing? Are some or all of these completely incompatible with each other? What about cabal-install and ghc? I am 80% certain that I installed ghc with apt-get. Does cabal come with it? I tried running "cabal update" and it complained about something being too new or too old. I fear I got myself into a terrible mess trying to install or uninstall things and I'm not terribly sure how to get to a known good state from there. It may be that I have here a very poor foundation for everything that follows, but I think I somehow got to a point where I could continue... I discovered that I have a darcs repository for xmonad and XMonadContrib. I went into each of these and did "darcs pull" and answered "a" when it asked which patches I wanted. I did "cabal install" in each in turn. xmonad built and installed itself somewhere, but XMonadContrib gave me an error: ~/xmonad/XMonadContrib$ cabal install Resolving dependencies... Configuring xmonad-0.9.2... Preprocessing library xmonad-0.9.2... Preprocessing executables for xmonad-0.9.2... Building xmonad-0.9.2... [1 of 8] Compiling XMonad.StackSet ( XMonad/StackSet.hs, dist/build/XMonad/StackSet.o ) [2 of 8] Compiling XMonad.Core ( XMonad/Core.hs, dist/build/XMonad/Core.o ) [3 of 8] Compiling XMonad.Layout ( XMonad/Layout.hs, dist/build/XMonad/Layout.o ) [4 of 8] Compiling XMonad.Operations ( XMonad/Operations.hs, dist/build/XMonad/Operations.o ) [5 of 8] Compiling XMonad.ManageHook ( XMonad/ManageHook.hs, dist/build/XMonad/ManageHook.o ) [6 of 8] Compiling XMonad.Config ( XMonad/Config.hs, dist/build/XMonad/Config.o ) [7 of 8] Compiling XMonad.Main ( dist/build/XMonad/Main.hs, dist/build/XMonad/Main.o ) [8 of 8] Compiling XMonad ( XMonad.hs, dist/build/XMonad.o ) Registering xmonad-0.9.2... [ 1 of 10] Compiling XMonad.StackSet ( XMonad/StackSet.hs, dist/build/xmonad/xmonad-tmp/XMonad/StackSet.o ) [ 2 of 10] Compiling XMonad.Core ( XMonad/Core.hs, dist/build/xmonad/xmonad-tmp/XMonad/Core.o ) [ 3 of 10] Compiling XMonad.Layout ( XMonad/Layout.hs, dist/build/xmonad/xmonad-tmp/XMonad/Layout.o ) [ 4 of 10] Compiling XMonad.Operations ( XMonad/Operations.hs, dist/build/xmonad/xmonad-tmp/XMonad/Operations.o ) [ 5 of 10] Compiling XMonad.ManageHook ( XMonad/ManageHook.hs, dist/build/xmonad/xmonad-tmp/XMonad/ManageHook.o ) [ 6 of 10] Compiling XMonad.Config ( XMonad/Config.hs, dist/build/xmonad/xmonad-tmp/XMonad/Config.o ) [ 7 of 10] Compiling XMonad.Main ( dist/build/xmonad/xmonad-tmp/XMonad/Main.hs, dist/build/xmonad/xmonad-tmp/XMonad/Main.o ) [ 8 of 10] Compiling Paths_xmonad ( dist/build/autogen/Paths_xmonad.hs, dist/build/xmonad/xmonad-tmp/Paths_xmonad.o ) [ 9 of 10] Compiling XMonad ( XMonad.hs, dist/build/xmonad/xmonad-tmp/XMonad.o ) [10 of 10] Compiling Main ( Main.hs, dist/build/xmonad/xmonad-tmp/Main.o ) Linking dist/build/xmonad/xmonad ... Installing library in /home/weeble/.cabal/lib/xmonad-0.9.2/ghc-6.12.1 Installing executable(s) in /home/weeble/.cabal/bin Registering xmonad-0.9.2... Configuring xmonad-contrib-0.9.1... Preprocessing library xmonad-contrib-0.9.1... Building xmonad-contrib-0.9.1... [ 1 of 212] Compiling XMonad.Util.StringProp ( XMonad/Util/StringProp.hs, dist/build/XMonad/Util/StringProp.o ) [ 2 of 212] Compiling XMonad.Util.Replace ( XMonad/Util/Replace.hs, dist/build/XMonad/Util/Replace.o ) [ 3 of 212] Compiling XMonad.Util.CustomKeys ( XMonad/Util/CustomKeys.hs, dist/build/XMonad/Util/CustomKeys.o ) [ 4 of 212] Compiling XMonad.Layout.ThreeColumns ( XMonad/Layout/ThreeColumns.hs, dist/build/XMonad/Layout/ThreeColumns.o ) [ 5 of 212] Compiling XMonad.Layout.StackTile ( XMonad/Layout/StackTile.hs, dist/build/XMonad/Layout/StackTile.o ) [ 6 of 212] Compiling XMonad.Layout.Spiral ( XMonad/Layout/Spiral.hs, dist/build/XMonad/Layout/Spiral.o ) [ 7 of 212] Compiling XMonad.Layout.Roledex ( XMonad/Layout/Roledex.hs, dist/build/XMonad/Layout/Roledex.o ) [ 8 of 212] Compiling XMonad.Layout.ResizableTile ( XMonad/Layout/ResizableTile.hs, dist/build/XMonad/Layout/ResizableTile.o ) [ 9 of 212] Compiling XMonad.Layout.OneBig ( XMonad/Layout/OneBig.hs, dist/build/XMonad/Layout/OneBig.o ) [ 10 of 212] Compiling XMonad.Layout.MultiToggle ( XMonad/Layout/MultiToggle.hs, dist/build/XMonad/Layout/MultiToggle.o ) [ 11 of 212] Compiling XMonad.Layout.MultiColumns ( XMonad/Layout/MultiColumns.hs, dist/build/XMonad/Layout/MultiColumns.o ) [ 12 of 212] Compiling XMonad.Layout.MosaicAlt ( XMonad/Layout/MosaicAlt.hs, dist/build/XMonad/Layout/MosaicAlt.o ) [ 13 of 212] Compiling XMonad.Layout.Mosaic ( XMonad/Layout/Mosaic.hs, dist/build/XMonad/Layout/Mosaic.o ) [ 14 of 212] Compiling XMonad.Layout.LayoutBuilder ( XMonad/Layout/LayoutBuilder.hs, dist/build/XMonad/Layout/LayoutBuilder.o ) [ 15 of 212] Compiling XMonad.Layout.HintedGrid ( XMonad/Layout/HintedGrid.hs, dist/build/XMonad/Layout/HintedGrid.o ) [ 16 of 212] Compiling XMonad.Layout.Simplest ( XMonad/Layout/Simplest.hs, dist/build/XMonad/Layout/Simplest.o ) [ 18 of 212] Compiling XMonad.Layout.Groups ( XMonad/Layout/Groups.hs, dist/build/XMonad/Layout/Groups.o ) [ 19 of 212] Compiling XMonad.Layout.GridVariants ( XMonad/Layout/GridVariants.hs, dist/build/XMonad/Layout/GridVariants.o ) [ 20 of 212] Compiling XMonad.Layout.Grid ( XMonad/Layout/Grid.hs, dist/build/XMonad/Layout/Grid.o ) [ 21 of 212] Compiling XMonad.Layout.FixedColumn ( XMonad/Layout/FixedColumn.hs, dist/build/XMonad/Layout/FixedColumn.o ) [ 22 of 212] Compiling XMonad.Layout.Dishes ( XMonad/Layout/Dishes.hs, dist/build/XMonad/Layout/Dishes.o ) [ 24 of 212] Compiling XMonad.Layout.Cross ( XMonad/Layout/Cross.hs, dist/build/XMonad/Layout/Cross.o ) [ 25 of 212] Compiling XMonad.Layout.Column ( XMonad/Layout/Column.hs, dist/build/XMonad/Layout/Column.o ) [ 26 of 212] Compiling XMonad.Layout.Circle ( XMonad/Layout/Circle.hs, dist/build/XMonad/Layout/Circle.o ) [ 27 of 212] Compiling XMonad.Hooks.XPropManage ( XMonad/Hooks/XPropManage.hs, dist/build/XMonad/Hooks/XPropManage.o ) [ 28 of 212] Compiling XMonad.Util.Timer ( XMonad/Util/Timer.hs, dist/build/XMonad/Util/Timer.o ) XMonad/Util/Timer.hs:38:2: Not in scope: `xfork' cabal: Error: some packages failed to install: xmonad-contrib-0.9.1 failed during the building phase. The exception was: ExitFailure 1 Have I done something wrong? At first I had even more problems, but I believe they were caused by my reckless use of "cabal install $SOMETHING" to try to fix previous problems, but which just ended up stacking more and more errors about conflicting versions. I got rid of these by doing "ghc-pkg list" and "ghc-pkg unregister --user $SOMETHING" for everything that turned up in the list of user packages. I have a few questions: 1. How can I get rid of everything and start again? 2. What do ghc-pkg and cabal install actually do, and where do they put things? Does one of them call the other? 3. When I install xmonad, where does it go? 4. What is the relationship between the xmonad executable and my xmonad.hs file? 5. When does xmonad.hs get read and processed? Every time xmonad runs? Every time I edit it? Only when I do something to specifically request it? 6. When there's an error in my xmonad.hs, what am I left with? Does xmonad behave as it did with the last known good xmonad.hs? Or does it use some sort of safe configuration? 7. What should I do in the future to avoid getting myself in a mess? Assuming that I will from time to time want to at least try out the latest version from darcs, what should I get using apt-get, what should I get with cabal, what (if anything) should I download source distributions for and what should I get from darcs? Wow, that' a lot of stuff, and I'm not even asking about debugging changes to my xmonad.hs. I'll leave that for another day when I've got a better handle on all this basic getting-it-all-up-and-running stuff. Many thanks for your patience. Weeble. [1] - http://code.google.com/p/xmonad/issues/detail?id=339

Hello Weeble, My suggestions follow inline, * On Saturday, January 15 2011, Weeble wrote: ...
Have I done something wrong? At first I had even more problems, but I believe they were caused by my reckless use of "cabal install $SOMETHING" to try to fix previous problems, but which just ended up stacking more and more errors about conflicting versions. I got rid of these by doing "ghc-pkg list" and "ghc-pkg unregister --user $SOMETHING" for everything that turned up in the list of user packages.
It seems that cabal install pulled in the xmonad-core-0.9.2 which is on hackage, instead of using the one you built from the darcs repository (whose version 0.9.1 until a few minutes ago). The release on hackage and the repos on code.haskell.org are mutually incompatible.
I have a few questions: 1. How can I get rid of everything and start again?
rm ~/.cabal; rm ~/.ghc
2. What do ghc-pkg and cabal install actually do, and where do they put things? Does one of them call the other?
They put files in those directories named above if you run them as an unprivileged user.
3. When I install xmonad, where does it go?
same as 1,2
4. What is the relationship between the xmonad executable and my xmonad.hs file?
The ~/.cabal/bin/xmonad calls ghc to compile your xmonad.hs, and then runs that executable.
5. When does xmonad.hs get read and processed? Every time xmonad runs? Every time I edit it? Only when I do something to specifically request it?
It is recompiled whenever xmonad starts and the modification time of xmonad.hs is newer than the generated executable (~/.xmonad/xmonad-$arch-$os). When you request a recompile "xmonad --recompile" or M-q modification times do not matter.
6. When there's an error in my xmonad.hs, what am I left with? Does xmonad behave as it did with the last known good xmonad.hs? Or does it use some sort of safe configuration?
It runs the ~/.xmonad/xmonad-$arch-$os, which is the last good configuration. If that doesn't exist, you're stuck with the default.
7. What should I do in the future to avoid getting myself in a mess? Assuming that I will from time to time want to at least try out the latest version from darcs, what should I get using apt-get, what should I get with cabal, what (if anything) should I download source distributions for and what should I get from darcs?
You can run ~/.xmonad/xmonad-$arch-$os as your window manager even if your xmonad install is broken. But then changes to the xmonad.hs will be ignored, at least until you get a working xmonad install with the ~/.cabal/bin/xmonad in your path. Adam

On Sat, Jan 15, 2011 at 6:45 PM, Adam Vogt
* On Saturday, January 15 2011, Weeble wrote:
1. How can I get rid of everything and start again?
rm ~/.cabal; rm ~/.ghc
Thanks! I emptied that out, installed cabal-install[1] and then went to my xmonad and XMonadContrib source directories and ran cabal install. Now I get a different error from XMonadContrib: [ 89 of 212] Compiling XMonad.Util.Image ( XMonad/Util/Image.hs, dist/build/XMonad/Util/Image.o ) XMonad/Util/Image.hs:24:39: Module `XMonad.Util.Font' does not export `fi' Any suggestions here? (After that failed I tried another darcs pull to see if there have been more changes that would help me, but it just seems to stall indefinitely at "Identifying repository http://code.haskell.org/XMonadContrib format". Is there a problem with the server?) Thanks for answering my other questions. I feel a lot more confident having some idea of what is happening where. Weeble. [1] - http://haskell.org/cabal/download.html

Hi, * On Saturday, January 15 2011, Weeble wrote: ...
I emptied that out, installed cabal-install[1] and then went to my xmonad and XMonadContrib source directories and ran cabal install. Now I get a different error from XMonadContrib:
[ 89 of 212] Compiling XMonad.Util.Image ( XMonad/Util/Image.hs, dist/build/XMonad/Util/Image.o )
XMonad/Util/Image.hs:24:39: Module `XMonad.Util.Font' does not export `fi'
Any suggestions here?
In the repository, run cabal clean Then try the build again.
(After that failed I tried another darcs pull to see if there have been more changes that would help me, but it just seems to stall indefinitely at "Identifying repository http://code.haskell.org/XMonadContrib format". Is there a problem with the server?)
Yes, code.haskell.org is not the most reliable, but I don't believe you need any more patches. Adam

On Sat, Jan 15, 2011 at 9:25 PM, Adam Vogt
* On Saturday, January 15 2011, Weeble wrote:
XMonad/Util/Image.hs:24:39: Module `XMonad.Util.Font' does not export `fi'
Any suggestions here?
In the repository, run
cabal clean
Then try the build again.
Hurrah! Thank you very much. Everything worked after that. I then added "handleEventHook = fullscreenEventHook" to my xmonad.hs file and full-screen now works in Google Chrome. I was very frustrated and confused this morning when I thought I had broken everything, so I'm really happy to have xmonad working better than before.
participants (2)
-
Adam Vogt
-
Weeble