Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

  1. #1
    Join Date
    Aug 2007
    Location
    La Plata
    Beans
    111
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    I'd like to share how to configure Xmonad to fit nicely in Gnome (replacing metacity as the window manager) and, as a plus, to be able to use Gnome Do as a launcher as well.

    This implies that you'll have the complete Gnome Desktop Environment (menus, taskbar, panels with clock, notification area, themes, fonts, wallpapers, etc) but with the advantage of having Xmonad as your window manager.
    I attached some screenshots of how it looks.

    Step 1: Installation

    First of all, you'll need to have xmonad and xmonad-contrib packages installed:
    1. xmonad
    2. libghc6-xmonad-dev
    3. libghc6-xmonad-contrib-dev


    If you are running Intrepid, all this packages are updated and work fine. If you are running Hardy, you'll have to include Intrepid main in your sources to access the updated libghc6-xmonad-contrib-dev package, which has the Gnome config file that allows Xmonad to play nicely with Gnome.

    Edit your /etc/apt/sources.list and include the following line:

    Code:
      # Intrepid sources
      deb http://archive.ubuntu.com/ubuntu intrepid main universe
    Now update your sources file and install the xmonad and xmonad-contrib packages listed above. You can disable the Intrepid packages later if you do not need/want them.

    You should now have xmonad installed. if you want to test it, you can log out of your session and log in again selecting xmonad in the GDM screen. You'll note that there are no panels, no background, etc. If you try to launch anything (alt+shift+enter launches a terminal, you can launch applications from there), the gtk theme won't be the one you probably have in gnome, etc. We'll have to tweak things a little to change all that.

    Step 2: Replacing Metacity

    To override metacity when logging in to gnome, create a file name .xsession in your home folder with the following content:

    Code:
      export WINDOW_MANAGER=xmonad
      exec gnome-session --purge-delay=3000
    Step 3: Tweaking Gnome Not necessary!

    You'll have to disable the desktop (this means you'll have no desktop icons, wich don't make much sense with a twm anyway). Type this in the command prompt:

    Code:
      gconftool-2 --type boolean --set /apps/nautilus/preferences/show_desktop false
    This step is not mandatory! You could do it anyway if you feel like it, but I found out that you can have your beloved desktop icons, it works anyway.

    Step 4: Tweaking Xmonad

    Create the directory .xmonad in your home folder, and the file xmonad.hs within it. Add the following lines:

    Code:
    import XMonad
    import XMonad.Config.Gnome
    
    main = xmonad gnomeConfig
    Save it and restart the X session normally. That's it!

    Step 5 (Optional): Further tweaking for Gnome Do

    If you are a Gnome Do user (and you should be!), you'll notice that Xmonad tries to handle Do's window like a regular one, resizing it to full screen. The following xmonad.hs file make it ignore Do's existence:

    Code:
    import XMonad
    import XMonad.Config.Gnome
    import XMonad.ManageHook
    
    myManageHook :: [ManageHook]
    myManageHook = 
        [ resource  =? "Do"   --> doIgnore ]
    
    main = xmonad gnomeConfig
        { manageHook = manageHook gnomeConfig <+> composeAll myManageHook }
    That should do the trick. You can also edit that config file to further customize it (focused window border color, for instance). Check out the Xmonad page

    I suggest you also add Vimperator to the mix (It's a Firefox addon that enables you to use vim-like keybindings for web browsing); you'll have a full-featured and keyboard driven working environment!

    For a more comprehensive guide, visit the following page: http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome
    Attached Images Attached Images
    Last edited by brunovecchi; November 10th, 2008 at 10:35 AM. Reason: Step 3 is not necessary

  2. #2
    Join Date
    Mar 2008
    Beans
    424

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    great idea. i have a few questions...
    could one also start gnome and then do F2 xmonad --replace (is that the right command?)? and for those using a transparent gnome-terminal, would using something like feh to set the wallpaper, still work? (can't see why it wouldn't, but i've not used gnome much.)
    also, would switching workspaces still work as it normally does in xmonad?

  3. #3
    Join Date
    Aug 2007
    Location
    La Plata
    Beans
    111
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    Quote Originally Posted by chucky chuckaluck View Post
    great idea. i have a few questions...
    could one also start gnome and then do F2 xmonad --replace (is that the right command?)?


    about xmonad --replace, I don't know if it'll work. This will surely do:

    Code:
    killall metacity && xmonad
    However, I think that creating the .xsession file is better, because this way you don't have to load metacity and then replace it with xmonad, you just load xmonad directly.

    and for those using a transparent gnome-terminal, would using something like feh to set the wallpaper, still work? (can't see why it wouldn't, but i've not used gnome much.)

    You don't need to use feh as a wallpaper, since gnome already handles it. If you use compositing for transparency, you should be able to see your background without using feh. You also change it the same way you'd change it in standard metacity gnome (via system->preferences).

    also, would switching workspaces still work as it normally does in xmonad?
    Switching workspaces will work just as it does with xmonad (via mod+number, or whatever you set it to in the config files). If you want the metacity keybindings, you should change them in the config file.

    Also, for changing focus between windows, both gnome (alt+tab) and xmonad (mod+j or mod+k) keybindings will work
    Last edited by brunovecchi; November 8th, 2008 at 06:17 PM.

  4. #4
    Join Date
    Mar 2008
    Beans
    424

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    i thought nautilus handled the wallpaper in gnome. that's why i wondered about what one would use instead.
    what you say about not starting metacity in the first place, is indeed preferred.

  5. #5
    Join Date
    Aug 2007
    Location
    La Plata
    Beans
    111
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    Quote Originally Posted by chucky chuckaluck View Post
    i thought nautilus handled the wallpaper in gnome. that's why i wondered about what one would use instead.
    Yes, it does! But we are not disabling nautilus here, just setting it to not show the desktop icons via gconf-editor. Wallpaper is displayed nonetheless.

  6. #6
    Join Date
    Mar 2008
    Beans
    424

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    Quote Originally Posted by brunovecchi View Post
    Yes, it does! But we are not disabling nautilus here, just setting it to not show the desktop icons via gconf-editor. Wallpaper is displayed nonetheless.
    ah, i see. i guess i had it mixed up with using nautilus in openbox, etc.

  7. #7
    Join Date
    Sep 2007
    Beans
    671
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    This isn't exactly working out for me:
    What happens is that whenever I open a window it just sits in the top left corner (not maximized) and none of the normal xmonad keybindings work....
    Anyone know what I'm doing wrong?

    EDIT: Ok, I'm pretty sure xmonad just isn't running.
    Which is totally the case.
    I'd worry about it not autostarting if I ever find myself having to logout often, but with this thing's extreme stability...
    Last edited by zmjjmz; November 9th, 2008 at 05:45 AM.
    2010 IBM Thinkpad 510, 4GB RAM, i5-540M, NVS 3100M

    Running Ubuntu 11.04

  8. #8
    Join Date
    Aug 2007
    Location
    La Plata
    Beans
    111
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    Quote Originally Posted by zmjjmz View Post
    This isn't exactly working out for me:
    What happens is that whenever I open a window it just sits in the top left corner (not maximized) and none of the normal xmonad keybindings work....
    Anyone know what I'm doing wrong?

    EDIT: Ok, I'm pretty sure xmonad just isn't running.
    Which is totally the case.
    I'd worry about it not autostarting if I ever find myself having to logout often, but with this thing's extreme stability...
    Have you solved your problem? If not, could you describe it further?
    For it to replace metacity, logging out and back in should do (Ctrl+Alt+Backspace).
    After changing xmonad's config file, just press Alt+Q and it will reload, no need to restart X.

    Side note: I also noted that it is not mandatory to disable desktop icons! So really there is nothing to lose here, it's a clean replacement for metacity!
    Last edited by brunovecchi; November 10th, 2008 at 10:36 AM.

  9. #9
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    690
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    Hi all

    Ive added xmonad and first impressions are that I like what I see!

    I have some issues with keybindings however.

    I can get a terminal, and from here I can run whatever packages I want. Howeve that means that every open window is taking up 2 processes, which to me seems excesive!

    How do I get a <menu> of some sort to pop up?? I've tried all the various suggested keybinding (such as <mod1 p> or on my terminal <alt p> but nothing shows up?

    I can confirm that certain other binding work, such as <alt ,> to shrink the size of the active window - it is this that appeals to me in fact.

    so my question is realy how do I get to set my keybindings, and also set some of my extra keys that I used to use in gnome? I have a mail, web and others that I had bound to certain stuff, and I'd like to keep them, if poss.

    Oh and I have a problem with java applications, a big thing as I'm a Java developer!

    Thanks in advance

    Dave
    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  10. #10
    Join Date
    Jun 2005
    Location
    Australia
    Beans
    247
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Tiling Window Manager (Xmonad) within Gnome with Gnome Do

    Nice idea, but it doesn't work for me. Xmonad starts, but it doesn't actually load properly:

    Code:
    xmonad: X11 error: BadAccess (attempt to access private resource denied), request code=2, error code=10

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •