If you ever try to run a GUI Java application when using xmonad as the Window Manager, you’ll probably end up with a nice flat grey window where your buttons, toolbars and other desktop GUI goodies should be. I ran into that problem the other day when trying to evaluate the RubyMine Ruby on Rails IDE from which I heard such good things. After a rather painful installation of the official Java 6 JDK from Oracle in Ubuntu Lucid Lynx (which I’ll write about in some other time), I managed to start up RubyMine just to find out I was seeing absolutely nothing on the screen.
I Googled a bit and essentially I found out that the problem was with the Java GUI Toolkit rather than RubyMine, because the framework relies on a list of window managers to handle some things, and xmonad is not in that list.
So since I was not using OpenJDK, I opted for the setWMName option and added this final line into my xmonad.hs file:
xmonad $ defaultConfig
{ terminal = myTerminal
, workspaces = myWorkspaces
, keys = keys'
, modMask = modMask'
, layoutHook = layoutHook'
, manageHook = manageHook'
, logHook = myLogHook dzenLeftBar >> fadeInactiveLogHook 0xdddddddd
, normalBorderColor = colorNormalBorder
, focusedBorderColor = colorFocusedBorder
, borderWidth = 2
, startupHook = setWMName "LG3D"
}
Setting the window manager name to LG3D will trick the Java GUI Toolkit and the application will be painted correctly.
Enjoy your Java applications with the power of xmonad!
I’ll guide you through the different steps I took to install a working desktop environment in Debian using xmonad, conky and dzen2.
The final result of this configuration should look like this:

xmonad with dzen2 and conky
Continue reading “Simple guide to configure xmonad, dzen2 and conky” »
November 21st, 2011 | tags:
haskell,
linux,
xmonad |
No Comments
For some reason, the ArchLinux wiki is kind of outdated explaining how to install xmonad in Arch. Also, the new packages seem to have a bug and the xmonad installation won’t work out of the box. Here you have detailed steps on how to install and run xmonad on ArchLinux.
First of all, you need to install the Xorg server. Refer to Xorg for detailed instructions. After that, you’ll need to install the xmonad packages, named xmonad and xmonad-contrib.
pacman -Syu xmonad xmonad-contrib
This will install xmonad and all the required dependencies. After that, if you want a fairly simple X setup, add the line xmonad to your ~/.xinitrc file (hopefully you’ll be using a display manager that uses that file like SLiM). If you try this on a freshly installed ArchLinux system, though, it won’t work. There are some missing steps to do. First of all, you need to create the folder ~/.xmonad.
After that, you need to create a new xmonad config file, called xmonad.hs
import XMonad
main = do
xmonad $ defaultConfig
Once you have you configuration file in place, it’s time to rebuild xmonad:
And that’s all, you should be able to start your fresh new xmonad setup in ArchLinux. By the way, if you wonder why pressing Mod1 + Shift + Enter does nothing, make sure you have the package xterm installed.
Cheers!
May 19th, 2011 | tags:
archlinux,
xmonad |
No Comments