Thursday, June 18, 2015

Install XMonad on OSX

  • OSX: 10.9.5 (Mavericks)
  • XMonad: 0.11.1
  • XQuartz: 2.7.7 (xorg-server 1.15.2)

Steps

  1. Download 195MB Haskel platform (Haskell Platform 2014.2.0.0 64bit.signed.pkg) from https://www.haskell.org/platform/mac.html
  2. Double-click on pkg file and install.

    Note the installer opens an brief intro at file:///Library/Haskell/doc/start.html

  3. Make sure XQuartz.app runs. It should open a terminal in X-Windows
  4. Update cabal (the Haskel package manager). In OSX terminal (not X11 terminal):
    $ cabal update
    Downloading the latest package list from hackage.haskell.org
    Note: there is a new version of cabal-install available.
    To upgrade, run: cabal install cabal-install
    $ cabal install cabal-install
    Resolving dependencies...
    Configuring cabal-install-1.22.6.0...
    Building cabal-install-1.22.6.0...
    Installed cabal-install-1.22.6.0
    $
    
  5. Install xmonad.
    $ cabal install xmonad
    ...
    [28 of 28] Compiling Graphics.X11     ( Graphics/X11.hs, dist/build/Graphics/X11.o )
    ld: library not found for -lXss
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    cabal: Error: some packages failed to install:
    X11-1.6.1.2 failed during the building phase. The exception was:
    ExitFailure 1
    xmonad-0.11.1 depends on X11-1.6.1.2 which failed to install.
    $ 
    
    Googling leads to this page (https://github.com/haskell-pkg-janitors/X11/issues/24) with the comment to try this:
    $ LIBRARY_PATH=/opt/X11/lib:$LIBRARY_PATH cabal install X11
    Resolving dependencies...
    Configuring X11-1.6.1.2...
    Building X11-1.6.1.2...
    Warning:
    /var/folders/cy/4988f14n4r35fp39wrt1pfq80000gn/T/pkgConf-X11-1.6.117333.2:
    Unrecognized field data-dir on line 35
    /var/folders/cy/4988f14n4r35fp39wrt1pfq80000gn/T/pkgConf-X11-1.6.117333.2:
    Unrecognized field key on line 4
    Installed X11-1.6.1.2
    $
    
    And we are good
    #% cabal install xmonad
    Resolving dependencies...
    Downloading xmonad-0.11.1...
    Configuring xmonad-0.11.1...
    Building xmonad-0.11.1...
    Warning:
    /var/folders/cy/4988f14n4r35fp39wrt1pfq80000gn/T/pkgConf-xmonad-0.1118683.1:
    Unrecognized field data-dir on line 28
    /var/folders/cy/4988f14n4r35fp39wrt1pfq80000gn/T/pkgConf-xmonad-0.1118683.1:
    Unrecognized field key on line 4
    Installed xmonad-0.11.1
    #
    
  6. Add symlink. For some reason, after installing with cabal, xmonad binary ended in ~/.cabal/bin not ~/Library/Haskell/bin
    $ cd $HOME
    $ ln .cabal/bin/xmonad Library/Haskell/bin/xmonad
    
  7. Create ~/.xinitrc.d/90-xmonad.sh
    $ mkdir ~/.xinitrc.d
    $ cat > ~/.xinitrc.d/90-xmonad.sh
    #! /bin/sh
    USERWM=$HOME/Library/Haskell/bin/xmonad
    ^D
    $ chmod +x ~/.xinitrc.d/90-xmonad.sh
    
  8. Configure XQuartz

  9. And open xmonad: alt-tab to make XQuartz active, then Option-Command-Shigt to make xmonad full screen.

No comments:

Post a Comment