Difference between revisions of "Xmonad/Using xmonad in Gnome"

From HaskellWiki
Jump to navigation Jump to search
(Started the gnome page)
 
m (mentioned prior to 0.5)
Line 53: Line 53:
   
 
=== From xmonad < 0.5 ===
 
=== From xmonad < 0.5 ===
To make space for the gnome-panel on the top of the screen, xmonad had to be manually configured to make space. This was done using the defaultGaps config option. This can now safely be taken out in favor of ManageDocks. See above.
+
To make space for the gnome-panel on the top of the screen, xmonad had to be manually configured to make space. Prior to xmonad 0.5, this was done using the defaultGaps config option. This can now safely be taken out in favor of ManageDocks. See above.
   
 
== Issues ==
 
== Issues ==

Revision as of 23:43, 3 January 2008

This is an updated version of the original gnome page.

Introduction

Xmonad makes a great drop-in replacement for Gnome's default window manager (metacity) giving the user a slick tiling window manager. This guide will help you get your version of gnome up and running with xmonad 0.5.

Assumptions

For this tutorial we assume:

  • you're using xmonad 0.5 or newer.
  • you have installed the xmonad 0.5 contrib files.
  • you have a working xmonad configuration and are already familiar with the basics of configuring and using xmonad.
  • you're using GNOME 2.18 or newer. If you're using an earlier version beware that configuration dialogs and the names of certain settings could be quite different from what is illustrated here.

The configuration

All configuration is done in the ~/.xmonad/xmonad.hs file.

From scratch

To make space for the gnome-panel/taskbar at the top, we setup the ManageDocks class:

import XMonad.Hooks.ManageDocks
main = xmonad defaultConfig 
               { manageHook = manageDocks
               , layoutHook = avoidStruts (tall ||| mirror tall ||| Full)
               }
             where tall = Tall 1 (3/100) (1/2)

For gnome to know about the windows and workspaces that xmonad creates, a class called EwmhDesktop exists. The configuration (from the EwmhDesktop page)looks like this:

import XMonad
import XMonad.Hooks.EwmhDesktops
myLogHook :: X ()
myLogHook = do ewmhDesktopsLogHook
               return ()
main = xmonad defaultConfig { logHook = myLogHook }

Putting it all together, a simple xmonad.hs configuraton file that works with Gnome might be:

import XMonad
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops

myLogHook :: X ()
myLogHook = do ewmhDesktopsLogHook
               return ()
main = xmonad $ defaultConfig
                { borderWidth      = 2
                , manageHook       = manageDocks
                , workspaces       = map show [1 .. 5 :: Int]
                , logHook          = myLogHook
                , layoutHook       = avoidStruts (tall ||| Mirror tall ||| Full)
                }
              where tall = Tall 1 (3/100) (1/2)

From xmonad < 0.5

To make space for the gnome-panel on the top of the screen, xmonad had to be manually configured to make space. Prior to xmonad 0.5, this was done using the defaultGaps config option. This can now safely be taken out in favor of ManageDocks. See above.

Issues

  • Be weary of the keyboard shortcuts that might conflict. For example, by default xmonad uses alt as the mod key. However, the shortcut alt-space (cycle layout) conflicts with gnome's default window management shortcut.