[xmonad] fix gnome-session fail-whale dialog and setup gnomeConfig if available

Jens Petersen petersen at fedoraproject.org
Thu May 12 09:59:24 UTC 2011


commit 3430944c9f204326996c8fb4b41381a59e3464b0
Author: Jens Petersen <petersen at redhat.com>
Date:   Thu May 12 18:53:28 2011 +0900

    fix gnome-session fail-whale dialog and setup gnomeConfig if available
    
    - xmonad-start no longer execs xmonad not to confuse gnome-session
    - xmonad-start now tries to setup a new xmonad.hs for GNOME desktop
      if running a xmonad-gnome session with xmonad-contrib installed
    - improvements to README.fedora

 README.fedora          |   51 +++++++++++++++++++++++++++++++++++------------
 xmonad-session.desktop |    1 -
 xmonad-start           |   22 +++++++++++++++++--
 xmonad.desktop         |    2 +-
 xmonad.spec            |   19 +++++++++--------
 5 files changed, 68 insertions(+), 27 deletions(-)
---
diff --git a/README.fedora b/README.fedora
index 2fb57dc..9c4e9c8 100644
--- a/README.fedora
+++ b/README.fedora
@@ -1,9 +1,42 @@
-To start xmonad from gdm, just select "xmonad" or "xmonad GNOME"
-from the GDM session menu.
+= From GDM =
+xmonad can be started from GDM, by selecting "xmonad" or "xmonad GNOME"
+from the session menu.
+
+= xmonad-start =
+By default at startup Fedora's xmonad-start displays
+"man xmonad" in an xterm to help newcomers and to encourage
+configuring xmonad by creating "~/.xmonad/xmonad.hs".
+
+To stop this behaviour, just create "~/.xmonad/".
+
+== Simple Desktop configuration ==
+The default xmonad configuration does not work well with desktop environments.
+
+The following basic generic configuration requires ghc-xmonad-contrib-devel
+to be installed, and should get it working:
+
+$ mkdir ~/.xmonad
+$ cat > ~/.xmonad/xmonad.hs << EOF
+import XMonad
+import XMonad.Config.Desktop
+
+main = xmonad desktopConfig
+EOF
+$ 
+
+You can replace the generic "[Dd]esktop" by:
+- "[Gg]nome" for better GNOME support
+- "[Kk]de[4]" for KDE support
+- "[Xx]fce" for XFCE support.
+
+See:
+- http://hackage.haskell.org/packages/archive/xmonad-contrib/latest/doc/html/XMonad-Config-Desktop.html
+- http://haskell.org/haskellwiki/Xmonad/Basic_Desktop_Environment_Integration
+for more info on how to setup desktop support.
 
 = How to configure =
 For documentation and examples see:
-- xmonad manpage
+- xmonad man-page
 - /usr/share/doc/xmonad-$version/xmonad.hs (full default basic configuration)
 - /usr/share/doc/ghc/html/libraries/xmonad-contrib-$version/index.html
 and online:
@@ -15,14 +48,6 @@ and online:
 To make use of extensions and Desktop Environment support,
 you need to install ghc-xmonad-contrib-devel.
 
-= EWMH Desktop support =
-xmonad does not work well with desktop environment panels out of the box.
-See:
-- http://hackage.haskell.org/packages/archive/xmonad-contrib/latest/doc/html/XMonad-Config-Desktop.html
-- http://haskell.org/haskellwiki/Xmonad/Basic_Desktop_Environment_Integration
-for how to setup desktop support.
-
 = Bluetile =
-New users may find the Bluetile window manager built
-on top of xmonad-contrib a gentler introduction to xmonad
-and tiling.
+New users may find the Bluetile window manager built on top of
+xmonad-contrib a gentler introduction to xmonad and tiling.
diff --git a/xmonad-session.desktop b/xmonad-session.desktop
index b949889..43d6b07 100644
--- a/xmonad-session.desktop
+++ b/xmonad-session.desktop
@@ -3,7 +3,6 @@ Name=xmonad
 Comment=Tiling window manager
 Exec=xmonad-start
 Terminal=false
-TryExec=xmonad-start
 
 [Window Manager]
 SessionManaged=true
diff --git a/xmonad-start b/xmonad-start
index 0f6a4e9..a349b24 100644
--- a/xmonad-start
+++ b/xmonad-start
@@ -1,8 +1,24 @@
 #!/bin/sh
 
-# display the manpage if there is no user configuration
 if [ ! -d ~/.xmonad ]; then
-  xterm -e man xmonad &
+    # display the manpage if there is no user configuration
+    xterm -e man xmonad &
+    xterm -e less /usr/share/doc/xmonad*/README.fedora &
+
+    # try to configure for a gnome session
+    if [ "$DESKTOP_SESSION" = "xmonad-gnome" ]; then
+	if ghc-pkg latest xmonad-contrib >/dev/null; then
+	    mkdir ~/.xmonad
+	    cat > ~/.xmonad/xmonad.hs <<EOF
+import XMonad
+import XMonad.Config.Gnome
+
+main = xmonad gnomeConfig
+EOF
+	else
+	    echo "xmonad-start: install ghc-xmonad-contrib-devel for GNOME support"
+	fi
+    fi
 fi
 
-exec xmonad
+xmonad
diff --git a/xmonad.desktop b/xmonad.desktop
index 1c62449..c257a7a 100644
--- a/xmonad.desktop
+++ b/xmonad.desktop
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Type=Application
 Name=XMonad
-Exec=xmonad
+Exec=/usr/bin/xmonad-start
 NoDisplay=true
 # name we put on the WM spec check window
 X-GNOME-WMName=Xmonad
diff --git a/xmonad.spec b/xmonad.spec
index fa4a007..a1ce67f 100644
--- a/xmonad.spec
+++ b/xmonad.spec
@@ -14,14 +14,9 @@ applied dynamically, and different layouts may be used on each\
 workspace. Xinerama is fully supported, allowing windows to be tiled\
 on several screens.
 
-%global ghc_pkg_deps ghc-mtl-devel, ghc-X11-devel
-
-# debuginfo is not useful for ghc
-%global debug_package %{nil}
-
 Name:           %{pkg_name}
 Version:        0.9.2
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        A tiling window manager
 
 Group:          User Interface/X
@@ -37,11 +32,11 @@ Source6:        xmonad.session
 Patch1:         xmonad-dynamic-link.patch
 # fedora ghc archs:
 ExclusiveArch:  %{ix86} x86_64 ppc alpha sparcv9 ppc64
-BuildRequires:  ghc, ghc-doc, ghc-prof
-BuildRequires:  ghc-rpm-macros >= 0.7.3
+BuildRequires:  ghc-prof
+BuildRequires:  ghc-rpm-macros
 BuildRequires:  hscolour
 BuildRequires:  desktop-file-utils
-%{?ghc_pkg_deps:BuildRequires:  %{ghc_pkg_deps}, %(echo %{ghc_pkg_deps} | sed -e "s/\(ghc-[^, ]\+\)-devel/\1-doc,\1-prof/g")}
+BuildRequires:  ghc-mtl-prof, ghc-X11-prof
 # required until there is a command to open a system-default xterminal
 Requires:       xterm
 # for xmessage
@@ -91,6 +86,12 @@ rm %{buildroot}%{_datadir}/%{name}-%{version}/man/xmonad.hs
 
 
 %changelog
+* Wed May 11 2011 Jens Petersen <petersen at redhat.com> - 0.9.2-7
+- xmonad-start no longer execs xmonad not to confuse gnome-session
+- xmonad-start now tries to setup a new xmonad.hs for GNOME desktop
+  if running a xmonad-gnome session with xmonad-contrib installed
+- improvements to README.fedora
+
 * Fri Apr 22 2011 Jens Petersen <petersen at redhat.com> - 0.9.2-6
 - drop explicit requires on ghc-xmonad-devel for lighter installs
 - update readme to mention gsettings for gnome3


More information about the scm-commits mailing list