Wednesday, June 24, 2015

Virtual Box (Ubuntu 14.04), i3 (window manager), and acme

My quest to use three-button mouse with acme on mac book continues.

  1. download 14.04 desktop iso
  2. create new virtual box server
  3. update
    1. tell ubuntu to update as part of install
    2. then run built-in updater
    3. then apt-get update/upgrade
    4. install virtualbox guest additions
    5. Create virtual box snapshot (so you can roll back to this state if you need to)

Install software

  1. apt-get install i3 git
  2. mkdir $HOME/src ; cd $HOME/src
  3. git clone https://github.com/9fans/plan9port.git
  4. cd plan9port
  5. ./INSTALL

Configure Mouse

I'm using Microsoft IntelliPoint mouse, as the middle button is decent. (I found wheels as middle button too hard to click.) Make sure to configure mouse so that middle button is "Handled by Mac OS".

To check, in Ubuntu terminal window, run xev then click in the white window that comes up. The mouse events will echo to the terminal. Buttons 1, 2, and 3 should be left, middle, and right respectively.

i3 Cheat Sheet

full screen
Alt-f
open menu
Alt-d
stack windows
Alt-s
tab windows
Alt-w
logout
Alt-Shift-e
quit window
Alt-Shift-q

Success

I now have a full three-button mouse for using acme editor in OSX.

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.