Personal tools

Installing xmonad log applet

From HaskellWiki

Revision as of 21:11, 20 January 2010 by Sereven (Talk | contribs)

Jump to: navigation, search

awick has created a gnome-panel applet to read and display xmonad logHook output, which frees gnome-panel users from the need to run an additional status bar to display xmonad information such as workspaces, titles, etc. See xmonad-log-applet for the project home page.

This page explains how to install and configure xmonad-log-applet-1.0 (or the git version which is currently identical but configured to install to lib/gnome-applets rather than libexec.)

Contents

1 Distro packages

Currently none AFAIK. (18 Jan 2010)

2 Preparing for the install

This is a highly experimental application that's seen very little testing. However, it's also small, simple, and unlikely to break other parts of your system. From here on in I'll assume you're comfortable installing unsupported gnome components outside your package manager's control. Unfortunately, so far as I know they must be installed to locations owned by gnome.

To compile the applet you will require a new enough gnu toolchain, libc, some additional C development files, and the applet source. To run it you will need xmonad, xmonad-contrib, ghc, and the hackage DBus package. If you have extremely limited disk space it's possible to build the applet on another host and simply install it on the small device, however that's outside the scope of this discussion.

So once you've made up your mind regarding these requirements, acquire the version of xmonad log applet source code that best meets your needs:

2.1 Choosing an applet version

Typically distros install gnome applets either to a libexec directory or to lib/gnome-applets. If your system uses libexec you will want to use the stable tarball build, if your system (like ubuntu karmic) uses lib/gnome-applets use the git version. For other setups you will need to edit the Makefile.in to match your install paths before running the configure script (see #Installing the applet).

To find your applet path, you can use locate, slocate, find, etc. with some applet you know was installed with your gnome-panel:

then@there $ # this system would use stable build tarball
then@there $ slocate gnome-keyboard-applet
/usr/libexec/gnome-keyboard-applet
now@here $ # this system would use git version
now@here $ locate null_applet
/usr/lib/gnome-applets/null_applet

Get the applet source of your choice by downloading and unpacking the tarball, or git cloning the git tree from the links on the project web page.

3 Installing C dependencies

Make sure you have a gnu toolchain, i.e. gcc, autotools and friends. (Install build-essential). Also install gnome-panel, libdbus1, libdbus-glib-1, and libpanel-applet-2 if you don't have them already. In debian land the libs will have -dev appended, i.e. libdbus1-dev, etc.

4 Installing haskell dependencies

You need the DBus package from hackage. If you don't already have it, install the cabal-install tool by following the instructions in the cabal-install section of the xmonad install page. Then run

cabal update
cabal install DBus

5 Installing the applet

In a terminal change to the directory containing the log applet source. If you need to modify any of the installation paths in the Makefile.in file edit it first before running the commands to configure and build the applet.

Once the Makefile.in paths are correct for your system, run

me@here xmonad-log-applet-1.0 $ ./configure

If you missed installing any of the C dependencies, or they installed to a non-standard location, the configure script will spit out an error telling what component it can't find and what it suggests you do about it. Fix it and re-try ./configure till it completes successfully.

Now run the following commands to build and install the applet, applet server and its icon:

me@here xmonad-log-applet-1.0 $ make
... <several lines of output>

me@here xmonad-log-applet-1.0 $ sudo make install
... <output explaining what got installed where>

Now to check that it installed correctly, run the following command to restart your gnome-panel:

me@here ~ $ gnome-panel --replace &

Now you should be able to add the applet to your gnome-panel. (Until xmonad is sending it data it will just say "Waiting for XMonad" but at this point it should be visible in your applet list and add to the panel without errors.)

If instead you get errors, the most likely things to go wrong would be bad or mismatched install paths, for example the applet tried to install to a non-existent or wrong directory. Also if you edited Makefile.in yourself make sure that the applet install path matches in both the server and the applet lines.

6 Configuring xmonad to write to the applet

7 Trouble

Check .xsession-errors for info from gnome-panel, xmonad, dbus, bonobo, etc. Try #xmonad on irc.freenode.net or the xmonad mailing list for help. Please pastebin or attach your xmonad.hs and what version of xmonad/xmonad-contrib you are using.