Installing xmonad log applet
(Create how to page for installing xmonad-log-applet)
(→Installing the applet: added information about "--with-panel" option to configuration, and compilation dependecy packages list for Ubuntu-12.10)
|(22 intermediate revisions by 3 users not shown)|
Revision as of 12:28, 9 May 2013
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.)
1 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:
1.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 xmonad-log-applet web page.
2 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.
3 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. You may also need libxml2 to install dbus on newer Ubnuntu distributions (eg: Ubuntu-12.10). You can get these by
sudo apt-get install libxml2-dev cabal update cabal install dbus
4 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 the configure script for perticular panel you are interested in (eg: gnome2, gnome3, mate, xfce4) by using "--with-panel=" option:
me@here xmonad-log-applet-1.0 $ ./configure --with-panel=gnome3
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. Here are few dependencies that you may have to install on Ubuntu-12-10 for gnome3:
me@here sudo apt-get install libglib2.0-dev libdbus-glib-1-dev libpanel-applet-4-dev
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 the wrong directory or one that doesn't exist at all. Also if you edited Makefile.in yourself make sure that the applet install path matches in both the server and the applet lines.
5 Configuring xmonad to write to the applet
The goal here is to merge your existing xmonad.hs with the sample xmonad.hs from the log applet website.
Probably simplest is to begin with the sample xmonad.hs, ensure it's working with your applet, and then bit by bit merge in your extra modifications to layoutHook, keybindings, etc. while leaving its main actions prior to running xmonad, and its logHook as in the sample. Then customize the logHook PP fields as you normally would to get the look you want, but using pangoColor formatting instead of dzen or xmobar colors.
If you want to work the other way around by modifying your existing xmonad.hs, your goal is to wrap everything you currently have in your version of 'main = ' to make use of the log-applet sample xmonad file's withConnection and getWellKnownName code, and modify your logHook ppOutput to use the dbus writer and error handling code.
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.