Kenyon Ralph

xmobar on Debian

How to install xmobar on Debian.

I already had zlib1g-dev and libxft-dev installed. zlib1g-dev would be pulled in by libghc6-zlib-dev anyway. Also already used aptitude to install xmonad, so that might have pulled in some dependencies necessary for the following steps.

  1. Debian instructions
    1. stm
    2. cabal
    3. HTTP and zlib
    4. cabal-install
    5. X11-xft
    6. xmobar
    7. Notes
  2. Old Ubuntu instructions
    1. Dependencies with Ubuntu packages
    2. Building cabal-install dependencies
    3. Building cabal-install
    4. Installing X11-xft
    5. Building xmobar
    6. xmobar.config
    7. External links

Debian instructions

stm

  1. sudo aptitude install libghc6-stm-dev # dependency of xmobar

cabal

Since Debian sid doesn’t have the Haskell X11-xft package, I want to install it with cabal-install, which Debian also does not have.

  1. darcs get --partial http://darcs.haskell.org/cabal-branches/cabal-1.6/ # (Per https://www.haskell.org/cabal/code.html.) Due to cabal-install’s dependence on Cabal >=1.6 && <1.7, but Debian sid has Cabal-1.2.3.0 at the moment, which is part of ghc6.
  2. cd cabal-1.6
  3. ghc --make Setup && ./Setup configure --user && ./Setup build && ./Setup install
  4. cd ..

HTTP and zlib

HTTP and zlib are dependencies of cabal-install.

  1. sudo aptitude install libghc6-http-dev libghc6-zlib-dev # pulls in libghc6-network-dev and libghc6-parsec-dev

Debian squeeze currently doesn’t have the required version of libghc6-http-dev, so following https://web.archive.org/web/20100914185529/http://projects.haskell.org/http/:

  1. git clone git://code.galois.com/HTTPbis.git
  2. runhaskell Setup configure --user && runhaskell Setup build && runhaskell Setup install

cabal-install

  1. darcs get --partial http://darcs.haskell.org/cabal-install/
  2. cd cabal-install
  3. runhaskell Setup configure --user && runhaskell Setup build && runhaskell Setup install
  4. cd ..

cabal binary is now installed as ~/.cabal/bin/cabal. I’ve added ~/.cabal/bin to my PATH.

X11-xft

  1. cabal update
  2. cabal install X11-xft

xmobar

  1. darcs get --partial http://code.haskell.org/xmobar/
  2. cd xmobar
  3. runhaskell Setup configure --user --flags="with_xft" && runhaskell Setup build && runhaskell Setup install

Now the xmobar binary is installed as ~/.cabal/bin/xmobar.

At first, Setup configure could not find X11-xft, even though ghc-pkg list showed X11-xft as being installed in my home directory. This was because I forgot the “--user” option to Setup configure.

Notes


Old Ubuntu instructions

(December 2008) I use xmonad on Ubuntu. I use the xmobar status bar with it. Ubuntu doesn’t have a package for xmobar, nor for many of its dependencies. So to build xmobar I had to build and install a bunch of dependencies. Also, in order to make installing Haskell packages easier, I installed cabal-install, which had its own dependencies.

Dependencies with Ubuntu packages

First some dependencies can be installed using aptitude. These are libxft-dev (for xft support in xmobar), and zlib1g-dev for building cabal-install.

Building cabal-install dependencies

Building parsec, stm, network, http, and zlib should now work with the command runhaskell Setup configure --user && runhaskell Setup build && runhaskell Setup install for each. Or you could use the bootstrap.sh included with cabal-install.

I think those are all of the dependencies.

Building cabal-install

Now cabal-install should install into your home directory with the standard Haskell configure, build, and install commands:

runhaskell Setup configure --user && runhaskell Setup build && runhaskell Setup install

Installing X11-xft

With cabal installed, a simple cabal install X11-xft should work.

Building xmobar

Finally, I was able to build xmobar. I’m using the version pulled directly from the darcs repository.

xmobar.config

Here is my ~/.xmonad/xmobar.config:

Config { font = "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
        , bgColor = "black"
        , fgColor = "grey"
        , position = TopW L 90
        , commands = [ Run Weather "KNKX" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
                    , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
                    , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
                    , Run Swap [] 10
                    , Run Com "uname" ["-s","-r"] "" 36000
                    , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
                    , Run StdinReader
                    ]
        , sepChar = "%"
        , alignSep = "}{"
        , template = "%StdinReader% }{ %cpu% | %memory% * %swap% | %eth0% <fc=#ee9a00>%date%</fc>| %KNKX% | %uname%"
        }
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. Revision History.