public
Last active

XMonad on Unity 2D (Ubuntu 11.10); Based on http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Unity_2D

  • Download Gist
xmonad-gnome-session.desktop
1 2 3 4 5 6 7
# in /usr/share/xsessions
[Desktop Entry]
Name=Xmonad GNOME
Comment=Tiling window manager
TryExec=/usr/bin/gnome-session
Exec=gnome-session --session=xmonad
Type=XSession
xmonad.desktop
1 2 3 4 5 6 7 8 9 10 11
# in /usr/share/applications
[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=true
xmonad.hs
Haskell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
-- in ~/.xmonad
 
import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.ManageDocks
import XMonad.Util.EZConfig
import XMonad.Layout.Gaps
import Data.List
 
myManageHook = composeAll . concat $
[ [ className =? "Firefox-bin" --> doShift "6:ff" ]
, [ className =? "Firefox" --> doShift "6:ff" ]
, [(className =? "Firefox" <&&> resource =? "Dialog") --> doFloat]
, [ className =? "Emacs" --> doShift "2:emacs" ]
, [ className =? "Emacsclient" --> doShift "2:emacs" ]
, [ className =? "Unity-2d-panel" --> doIgnore ]
, [ className =? "Unity-2d-launcher" --> doIgnore ]
]
 
myLayouts = gaps [(U, 24)] $ layoutHook gnomeConfig
 
main = xmonad $ gnomeConfig
{ workspaces = ["1:chrome","2:emacs","3:console","4:server","5:mail","6:ff","7","8","9","0","-","="]
, manageHook = myManageHook <+> manageHook gnomeConfig
, modMask = mod4Mask
, layoutHook = myLayouts
, terminal = "urxvt"
, focusFollowsMouse = False
}
`additionalKeysP` [ ("M-S-q", spawn "gnome-session-quit --power-off") ]
xmonad.session
1 2 3 4 5 6 7
# in /usr/share/gnome-session/sessions
[GNOME Session]
Name=Xmonad Unity-2D Desktop
RequiredComponents=gnome-settings-daemon;
RequiredProviders=windowmanager;panel;
DefaultProvider-windowmanager=xmonad
DefaultProvider-panel=unity-2d-panel

You'll note that my Xmonad configuration makes the Windows/Command key the modifier, rather then control, so as not to interfere w/ Emacs bliss. I also configured Xmonad to only display Emacs and Firefox on specific work spaces (2 and 6, respectively).

Known issue: in dual monitor mode, the unity menu bar does not render the proper width on one of the monitors if the monitors have different resolutions. Right now I don't care.

Hi,

I'll have a question even if I didn't try your configuration yet. However, I tried another recipe and went on to adapt my existing configuration.

What I would like to do is to have only unity-2d-panel and not unity-2d-launcher. Yet I also want the menubars (i.e. Firefox's menus, or any other ordinary gnome application's) to appear in unity-2d-panel. But it doesn't work as I like right away if I just comment out unity-2d-launcher from relevant files.

Could the reason be me not executing unity-2d-launcher?

Can you give me a pointer about the connection between the menubars in the panel and the applications?

Thank you in advance.

@onurgu for unity-2d-panel you can give doFloat instead of doIgnore

@kofno How is xmonad.session used?

i would read comments too :eyes:

Wow, too much noise in my github feed I guess @gokulnath

@trygvis that is the session configuration that is fed to gnome-session when it starts and tells it what services to use.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.