Skip to content

Instantly share code, notes, and snippets.

@afldcr
Created July 6, 2015 22:34
Show Gist options
  • Save afldcr/ce482fd70e27428cf37f to your computer and use it in GitHub Desktop.
Save afldcr/ce482fd70e27428cf37f to your computer and use it in GitHub Desktop.
Install xmonad, xmonad-contrib, and xmobar in OS X
#!/bin/fish
# this assumes that ~/.local/xmonad/bin is a part of your $PATH
function xmonad_mac
# enforce OSX
if [ (uname) != 'Darwin' ]
echo "This is an OSX specific script. Aborted"
return 1
end;
# set up the build enviornment in /tmp
set WORKDIR /tmp/xmonad(random)
set DESTDIR $HOME/.local/xmonad
set OLDDIR (pwd)
mkdir -p $WORKDIR
rm -rf $DESTDIR
cd $WORKDIR
# fix the enviornment variables
set -x LIBRARY_PATH /opt/X11/lib $LIBRARY_PATH
set -x CFLAGS "-I/opt/X11/include"
set -x CPPFLAGS "-I/opt/X11/include"
set -x LDFLAGS "-L/opt/X11/lib"
set -x PKG_CONFIG_PATH /usr/X11/lib/pkgconfig
# get to work with cabal
cabal sandbox init
cabal install -j4 --extra-include-dirs=/opt/X11/include \
xmonad xmonad-contrib xmobar
and mv $WORKDIR/.cabal-sandbox/ $DESTDIR
and echo "Installation successful! Cleaning up."
or echo "Installation failed. Cleaning up..."
cd $OLDDIR
rm -r $WORKDIR
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment