Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Xmonad/Using xmonad in Gnome
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Setting up Gnome to use Xmonad== Overall most people on a variety of distros seem to get best results by using an <code>applications/xmonad.desktop</code> file and running a full gnome session replacing only gnome's window manager. They tell gnome-session to use xmonad instead of metacity by running: <pre># gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string</pre> Doing this from inside a full gnome session will replace metacity with xmonad and continue to run all the other gnome daemons and apps. See 'man gnome-wm' for details. (For MATE, the command is similar but not identical: <tt>dconf write /org/mate/desktop/session/required-components/windowmanager "'xmonad'"</tt>.) See below to set up a separate customized xmonad or ~/.xsession based session separate from your gnome one. For xmonad to start automatically on login you need an <code>applications/xmonad.desktop</code> file on your system. If your distro doesn't provide it, create the following file: <pre> $ cat /usr/share/applications/xmonad.desktop [Desktop Entry] Type=Application Encoding=UTF-8 Name=Xmonad Exec=xmonad NoDisplay=true X-GNOME-WMName=Xmonad X-GNOME-Autostart-Phase=WindowManager X-GNOME-Provides=windowmanager X-GNOME-Autostart-Notify=false </pre> Alternatively, you can create the above as <code>~/.local/share/applications/xmonad.desktop</code> for the current user only. To run a separate xmonad session in addition to gnome session(s) you need an <code>xsessions/xmonad.desktop</code> file. To start a minimal xmonad session from gdm (see notes* below to run more than just xmonad on login), create the following file: <pre> $ cat /usr/share/xsessions/xmonad.desktop [Desktop Entry] Encoding=UTF-8 Name=XMonad Comment=Lightweight tiling window manager Exec=xmonad Icon=xmonad.png Type=XSession </pre> Your display manager must also be able to find the xmonad executable. If you are not using your distro package manager to install xmonad, for best results configure your build to install xmonad to a location in the system environment like /usr/local/bin/. <nowiki>*NOTE:</nowiki> Using an <code>xsessions/xmonad.desktop</code> file that runs a custom script <code>xmonad.start</code> instead of just plain xmonad is also how to add other startup actions to the gdm xmonad.desktop startup, such as starting gnome daemons, apps, etc. See [http://arjuna.deltoso.net/articoli/my-configuration-of-xmonad-window-manager-with-xmobar-and-trayer/en arjuna's blog] for more details. (simono says: Creating <code>/usr/share/xsessions/xmonad.desktop</code> and <code>/usr/local/bin/xmonad.start</code> files is the preferred method for configuring an alternative window manager. The applications/xmonad.desktop file is still required.) However, see the xsession section below to continue using the classic ~/.xsession method to run a custom session. ====Gnome3==== Gnome 3.8 and later only support gnome-shell as a window manager; it is not possible to integrate xmonad or any other window manager with it, absent a backport of gnome-fallback / gnome-flashback. [http://therning.org/magnus/posts/2011-05-08-938-xmonad-and-gnome-3.html This blog post] has instructions for integrating xmonad with Gnome3 and gnome-flashback on archlinux. It should also work for most other distros that don't work out of the box. (E.g. Fedora 15 should "just work".) Note that these instructions will not work with a fresh Ubuntu 11.10 install, since bits of Gnome are missing in the release. (See below for details.) With Debian (and probably other distributions) you can also create a custom, user-specific session. For example, assume you would like to run XMonad with Gnome, but without any Gnome panels; you can do so like like this. Create a ~/.config/gnome-session/sessions/xmonad-gnome-nopanel.session file like this: <pre> [GNOME Session] Name=XMonad/Gnome (without gnome-panel) RequiredComponents=gnome-settings-daemon; RequiredProviders=windowmanager;notifications; DefaultProvider-windowmanager=xmonad DefaultProvider-notifications=notification-daemon </pre> Create an executable ~/.xsession file, symlinked from ~/.xinitrc like this: <pre>exec gnome-session --session xmonad-gnome-nopanel "$@"</pre> And then specify "System Default" for the session when logging in via gdm3. Finally, note that many Gnome3 features such as the gnome shell are part of the mutter window manager. You can't use part of mutter plus part of some other window manager. ====A Simple Hybrid Alternative==== There is also a hybrid method that seems to work much more simply and easily than the custom start script, while still allowing XMonad to be chosen as a separate session. <code>applications/xmonad.desktop</code> and <code>xsessions/xmonad.desktop</code> are created as above. And, as above, <code>xsessions/xmonad.desktop</code> points to a custom <code>xmonad.start</code> script. But, the contents of the xmonad.start script are simply the following: <pre> export WINDOW_MANAGER=xmonad gnome-session </pre> This gives all the bells and whistles of gnome, including integrated logout support, etc, while also allowing xmonad and gnome to be selected as separate sessions from the login screen. Note that if you go this road with Ubuntu 10.04 (tested with gnome 2.30.0), you will also need to unset the gconf windowmanager setting. <code>gconftool-2 -u /desktop/gnome/session/required_components/windowmanager</code> That alone didn't work for me. I have this in my xmonad.start instead <pre> gconftool-2 -t string -s /desktop/gnome/session/required_components/windowmanager xmonad gconftool-2 -t string -s /desktop/gnome/applications/window_manager/current xmonad </pre> After startup I am running <pre> killall compiz xmonad & </pre> ===Debian=== The Debian xmonad package comes, since version 0.9.2-3, with the file necessary to start a GNOME3-Fallback session with xmonad instead of metacity from GDM; just select it from the list of possible sessions. Eventually, when the new package migrates there, this will also hold for Ubuntu. ===Ubuntu=== [See below for version-specific instructions] I had tried above methods described by "simple hybrid", but they are not staight forward and didn't work. <pre> export WINDOW_MANAGER=/path to xmonad gnome-sesson </pre> If once I execute "gnome-wm" manually, after that it works, I got xmonad integrated in gnome well. However, once I switch to my gnome session, and then return back to my xmonad session, the xmonad window manager isn't run, just as I log into the gnome session. After delving into gnome-wm script and some analysis and many try, I found out why the plain script did not work. Because I had turned on the "auto save gnome session" function, I guess gnome-session wouldn't call gnome-wm again when I change from gnome session to xmonad session. So I disable the save session function, and remove the files in <code>.config/gnome-session/saved-session/*</code>. Finally it works! This indirectly prove the above guess is right. Actually I had put this script to xmonad-custom.start, then I can have gnome and xmonad session seperated, and they don't interfere with the other. I think this method is simple yet elegant, and easy to understand. ===Ubuntu Wily=== As for the other methods, some simple configuration files are needed in /usr/share/... directories. I try to keep this section self contained. There are 4 files needed in this method: * A ".desktop" configuration file in "/usr/share/xsessions/". The file populates the display manager (lightdm in my case) with a desktop environment listing that a user can select when logging in. <pre> >cat /usr/share/xsessions/gnome-xmonad.desktop</pre> <pre> [Desktop Entry] Name=GNOME with Xmonad Comment=A GNOME fallback mode session using xmonad as the window manager. Exec=/usr/bin/gnome-session-xmonad TryExec=/usr/bin/gnome-session Icon= Type=Application </pre> * An executable, somewhere, which invokes the "xmonad" gnome session. The script must be pointed to by the xsession config, above. <pre> >cat /usr/bin/gnome-session-xmonad </pre> <pre> #!/bin/sh exec gnome-session --session=xmonad "$@" </pre> * The gnome "xmonad" session config in /usr/share/gnome-session/sessions/ . This configuration file describes the xmonad session invoked by the script. It is responsible for declaring the various components loaded by gnome. <pre> >cat /usr/share/gnome-session/sessions/xmonad.session </pre> <pre> [GNOME Session] Name=XMonad/Unity RequiredComponents=gnome-flashback-init;gnome-flashback;xmonad;unity-settings-daemon;gnome-flashback-services; </pre> :This file was copied from the distribution's "gnome-flashback-metacity", session file, with metacity replaced with xmonad. Also, "gnome-panel" was not loading on log-in, so I removed it from here. * /usr/share/applications/xmonad.desktop : This configuration file tells gnome about the xmonad application, so that it can be loaded in the session file. <pre> >cat /usr/share/applications/xmonad.desktop </pre> <pre> [Desktop Entry] Type=Application Encoding=UTF-8 Name=Xmonad Exec=xmonad NoDisplay=true X-GNOME-WMName=Xmonad X-GNOME-Autostart-Phase=WindowManager X-GNOME-Provides=windowmanager X-GNOME-Autostart-Notify=false </pre> As A final step, gnome-panel wasn't loading up properly so on first log-in I started a terminal (ctl+Meta+Enter for my xmonad key bindings) and entered gnome-panel at the prompt. From the panel, I went to systemTools>preferences>startupApplications and added an entry for gnome-panel. ===Ubuntu Precise=== Installing xmonad in Precise adds a "GNOME with XMonad" session option, but as of 2012-07-11, this session doesn't work out-of-the-box, due to a missing gnome-panel dependency (see https://bugs.launchpad.net/ubuntu/+source/xmonad/+bug/989405). Installing gnome-panel ("sudo apt-get install gnome-panel") adds the missing dependency and allows built-in session to function properly. Alternatively, it's possible to customize the Gnome Classic session by adding the following to ~/.gnomerc <pre> export WINDOW_MANAGER=xmonad </pre> and using an xmonad.hs like the following <pre> import XMonad import XMonad.Config.Gnome main = do xmonad $ gnomeConfig </pre> ===Ubuntu Oneiric=== [These instructions assume you've installed Ubuntu's xmonad package from apt and might not work for cabal or source installs.] To set up Gnome to use Xmonad in Oneiric, you first need to add a new Gnome Session description to /usr/share/gnome-session/sessions/. Save the following as xmonad.session: <pre> [GNOME Session] Name=Xmonad/GNOME RequiredComponents=gnome-settings-daemon; RequiredProviders=windowmanager; DefaultProvider-windowmanager=xmonad </pre> Next you need to create an Xsession description. If you installed Xmonad from apt you'll already have an Xsession for running Xmonad without Gnome at /usr/share/xsessions/xmonad.desktop. You can either overwrite that default session (not recommended) or create a new one at /usr/share/xsessions/xmonad-gnome.desktop which looks like this: <pre> [Desktop Entry] Name=Xmonad/GNOME Comment=Tiling window manager Exec=gnome-session --session=xmonad TryExec=/usr/bin/gnome-session Type=XSession </pre> This should add an entry to the sessions menu in LightDM, called Xmonad/GNOME. Select this option before you log in to start a Gnome session with Xmonad goodness. To make this the default session, change /etc/lightdm/lightdm.conf so that it contains the line <pre> user-session=SESSION_NAME </pre> where SESSION_NAME should be the name of the Xsession defined above (we suggested xmonad-gnome). Note that Ubuntu's flavour of Gnome 3 shows the menu bar for the focused window at the top of the screen, presumably because Unity wants it there. Even in Classic Gnome, it's there, hiding behind gnome-panel. There should be an option in dconf-editor that will make it go away. ===Ubuntu Natty=== ====Using New Session Files==== On Natty you need to create a new gnome session description at /usr/share/gnome-session/sessions/xmonad.session which should look something like this <pre> [GNOME Session] Name=Xmonad Required=windowmanager;panel;filemanager; Required-windowmanager=xmonad Required-panel=gnome-panel Required-filemanager=nautilus DefaultApps=gnome-settings-daemon; </pre> You should also create a file at /usr/share/xsessions/xmonad.desktop with contents like this <pre> [Desktop Entry] Name=XMonad Comment=Lightweight tiling window manager + Gnome Exec=gnome-session --session=xmonad Icon= Type=Application X-Ubuntu-Gettext-Domain=gnome-session-2.0 </pre> And then select the Xmonad session when logging in with GDM. I also had to uninstall the appmenu stuff to get my menus back for some reason. Not sure what the problem with the global menus are in Natty since the Gnome Classic session gets normal in-window menus and the appmenu panel still works. With xmonad it just seems totally broken. ====Using GConf==== Rather than having an administrator create new .desktop and .session files, an unprivileged user may configure gnome-wm to use Xmonad as Gnome's window manager through GConf as described at [[#Setting_up_Gnome_to_use_Xmonad]]. This approach worked in previous versions of Ubuntu but at present with Natty, if /usr/lib/nux/unity_support_test is not installed, an administrator may have to comment out or remove the IsRunnableHelper line from /usr/share/xsessions/gnome-classic.desktop: # IsRunnableHelper=/usr/lib/nux/unity_support_test --compiz Logging in using the "Ubuntu Classic" session will then launch Xmonad and all the other Gnome widgets. See also [https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/774357 Ubuntu Bug#774357]. ===Ubuntu Karmic=== Follow the above general instructions. Most people will probably want to use the "simple hybrid method", .xsession, or use gconftool to replace metacity in a full gnome session running all the other supporting gnome apps. You may also wish to install xterm if you don't already have it, since it's the terminal used by the default xmonad setup, at least till you get the gnomeConfig up and running as discussed in later sections. ====using xsession under karmic==== <nowiki>*NOTE:</nowiki>Ubuntu Karmic Koala users still can use their ~/.xsession scripts to run xmonad. For this, you need: 1. sudo mkdir /etc/X11/sessions 2. put into /etc/X11/sessions/Xsessions.desktop: <pre> [Desktop Entry] Name=Xsession Comment=This runs ~/.xsession Exec=/etc/X11/Xsession </pre> 3. Then Xsession entry will appear in gdm, and will work as it worked for many years. WINDOW_MANAGER variable looks still working, you can use smth like: <pre> export WINDOW_MANAGER="/path/to/xmonad" exec gnome-session </pre> in your ~/.xsession For more info on this, check gdm bug description at launchpad [https://bugs.launchpad.net/ubuntu/karmic/+source/gdm/+bug/398300]. ====xmonad-0.9 for karmic==== [http://www.haskell.org/pipermail/xmonad/2009-November/009060.html This mailing list thread] has instructions to use a PPA for newer xmonad, dzen, xmobar. ===Ubuntu Jaunty=== At least 3 XMonad users have found that the <tt>~/.gnomerc</tt> will not work on Jaunty Ubuntu when one is upgrading from Intrepid; apparently the <tt>~/.gconf/</tt> directory is incompatible or something, so Gnome/Ubuntu will not read .gnomerc and any settings in it will be ignored. The work-around is essentially to remove .gconf entirely. On the next login, a fresh default .gconf will be created and .gnomerc will be read. This of course implies that one's settings and preferences will also be removed, and one will have to redo them. (Copying over selected directories from the old .gconf to the new one may or may not work.) Or alternatively, the following worked for me (without touching .gconf or .gnomerc or exports): Add an xmonad launcher in the gnome-session-properties and then execute: $ gconftool -t string -s /desktop/gnome/applications/window_manager/current xmonad $ gconftool -t string -s /desktop/gnome/session/required_components/windowmanager xmonad $ killall metacity; xmonad & Also make sure to add the /usr/share/applications/xmonad.desktop file shown above, if it's not already present. This lets gnome know that xmonad is a windowmanager and where to look for it. ====newer haskell and xmonad for jaunty==== [https://launchpad.net/~gspreemann/+archive/haskell gspreemann's PPA] has newer haskell toolchain without some of the setup problems others have had, as well as xmonad-0.9. ===Ubuntu Intrepid=== [http://ubuntuforums.org/showthread.php?t=975329 This forum thread] has instructions for making Gnome play nice with xmonad on intrepid. ===Fedora=== Recent Fedora xmonad packages provide /usr/share/applications/xmonad.desktop and /usr/share/xsessions/xmonad.desktop, so the above generic instructions should "just work" (but not the "Simple Hybrid Alternative"). ====Fedora 15==== Installing xmonad or bluetile should "just work" out of the box. Select "xmonad GNOME" or "GNOME + bluetile" at the gdm prompt. ====Fedora 10 and further links==== [http://thread.gmane.org/gmane.comp.lang.haskell.xmonad/6557 This old mailing list thread] contains fedora 10 specific setup instructions, but also a bunch of other gnome setup links if you are having trouble with the above methods. ===Using the startup applications menu to modify your gnome session=== An alternative to using gconftool to change the window manager in a gnome session: On many distros you can replace metacity in your full gnome session by using the gnome menus to create a new item in the System>Preferences>Startup Applications menu Programs tab to run xmonad as window manager. (Disable "automatic saving of session components on logout" to use this setup method.) For example, for '''Name:''' you could use "Window Manager XMonad", then for '''Program:''' use <code>xmonad</code>. Un-check the old Metacity one (typically called Window Manager and using '''Program''' <code>gnome-wm</code>). Don't delete or over-write it so you can switch back if you want. Click the checkbox to turn on the new "Window Manager XMonad" entry instead, save your session, log out and log back in choosing gnome-session. If it's not already there, this will create the applications/xmonad.desktop file discussed above. (Not a great method for people who switch frequently between metacity, compiz, and xmonad.)
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width