[xmonad] - add application desktop file for gnome-session to find xmonad so setting /desktop/gnome/session/
Jens Petersen
petersen at fedoraproject.org
Sun Sep 12 12:42:33 UTC 2010
commit 2902f660a1192a519511a1d155a3fa948ca5eaa9
Author: Jens Petersen <jens at 192-168-1-2.tpgi.com.au>
Date: Sun Sep 12 22:42:04 2010 +1000
- add application desktop file for gnome-session to find xmonad
so setting /desktop/gnome/session/required_components/windowmanager now works
- add xmonad-dynamic-link.patch to dynamically link customized xmonad
- move display of manpage for new users from xmonad.hs to xmonad-start
and only display it when no ~/.xmonad/
- drop skel file and dont create ~/.xmonad by default
README.fedora | 48 +++++++++++++++++++++++++++++++++++++++++++
xmonad-config-manpage.patch | 13 -----------
xmonad-dynamic-link.patch | 12 ++++++++++
xmonad-session.desktop | 11 +++++++++
xmonad-start | 4 +-
xmonad.desktop | 18 ++++++++--------
xmonad.spec | 28 +++++++++++++++++--------
7 files changed, 101 insertions(+), 33 deletions(-)
---
diff --git a/README.fedora b/README.fedora
new file mode 100644
index 0000000..a1ea716
--- /dev/null
+++ b/README.fedora
@@ -0,0 +1,48 @@
+= Configuration information =
+For information, examples, and documentation, please see:
+
+- man xmonad
+- "/usr/share/doc/xmonad-$version/xmonad.hs" (full default basic configuration)
+- Xmonad wiki: http://www.haskell.org/haskellwiki/Xmonad
+- http://hackage.haskell.org/packages/archive/xmonad-contrib/latest/doc/html/XMonad-Doc.html
+ (detailed configuration information and examples)
+- http://xmonad.org/ website
+
+For extensions, including Desktop support, you need to install
+ghc-xmonad-contrib-devel.
+
+== Desktop support ==
+xmonad does not work well with modern desktop environments out of the box.
+Example xmonad configurations for use with a desktop:
+
+=== Generic EWMH Desktop support ===
+
+$ cat > xmonad.hs <<EOF
+import XMonad
+import XMonad.Config.Desktop
+
+main = xmonad $ desktopConfig
+EOF
+$ mkdir -p ~/.xmonad/
+$ cp -i xmonad.hs ~/.xmonad/
+
+Then (re)start xmonad and it will compile and run the configuration.
+
+=== GNOME ===
+Modify above file:
+
+$ sed -i -e s/Config.Desktop/Config.Gnome/ -e s/desktopConfig/gnomeConfig/ ~/.xmonad/xmonad.hs
+
+Set xmonad as default window manager:
+
+$ gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string
+
+=== KDE ===
+Modify above file:
+
+$ sed -i -e s/Config.Desktop/Config.Kde/ -e s/desktopConfig/kdeConfig/ ~/.xmonad/xmonad.hs
+
+=== Xfce ===
+Modify above file:
+
+$ sed -i -e s/Config.Desktop/Config.Xfce/ -e s/desktopConfig/xfceConfig/ ~/.xmonad/xmonad.hs
diff --git a/xmonad-dynamic-link.patch b/xmonad-dynamic-link.patch
new file mode 100644
index 0000000..923f6d5
--- /dev/null
+++ b/xmonad-dynamic-link.patch
@@ -0,0 +1,12 @@
+diff -u xmonad-0.9.1/XMonad/Core.hs\~ xmonad-0.9.1/XMonad/Core.hs
+--- xmonad-0.9.1/XMonad/Core.hs~ 2009-12-17 09:25:04.000000000 +1000
++++ xmonad-0.9.1/XMonad/Core.hs 2010-09-12 16:39:48.553458230 +1000
+@@ -420,7 +420,7 @@
+ -- temporarily disable SIGCHLD ignoring:
+ uninstallSignalHandlers
+ status <- bracket (openFile err WriteMode) hClose $ \h -> do
+- waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir)
++ waitForProcess =<< runProcess "ghc" ["-dynamic", "--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir)
+ Nothing Nothing Nothing (Just h)
+
+ -- re-enable SIGCHLD:
diff --git a/xmonad-session.desktop b/xmonad-session.desktop
new file mode 100644
index 0000000..799d921
--- /dev/null
+++ b/xmonad-session.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=xmonad
+Comment=Tiling window manager
+Exec=xmonad-start
+Terminal=False
+TryExec=xmonad-start
+
+[Window Manager]
+SessionManaged=true
+# vi: encoding=utf-8
diff --git a/xmonad-start b/xmonad-start
index f4f3472..035bfe8 100644
--- a/xmonad-start
+++ b/xmonad-start
@@ -1,8 +1,8 @@
#!/bin/sh
+# display the manpage if there is no user configuration
if [ ! -d ~/.xmonad ]; then
- mkdir -p ~/.xmonad
- cp /etc/skel/.xmonad/xmonad.hs ~/.xmonad/
+ xterm -e man xmonad
fi
exec xmonad
diff --git a/xmonad.desktop b/xmonad.desktop
index 799d921..b874e04 100644
--- a/xmonad.desktop
+++ b/xmonad.desktop
@@ -1,11 +1,11 @@
[Desktop Entry]
+Type=Application
Encoding=UTF-8
-Name=xmonad
-Comment=Tiling window manager
-Exec=xmonad-start
-Terminal=False
-TryExec=xmonad-start
-
-[Window Manager]
-SessionManaged=true
-# vi: encoding=utf-8
+Name=XMonad
+Exec=xmonad
+NoDisplay=true
+# name we put on the WM spec check window
+X-GNOME-WMName=Xmonad
+X-GNOME-Autostart-Phase=WindowManager
+X-GNOME-Provides=windowmanager
+X-GNOME-Autostart-Notify=true
diff --git a/xmonad.spec b/xmonad.spec
index 89570b5..8a560e9 100644
--- a/xmonad.spec
+++ b/xmonad.spec
@@ -22,7 +22,7 @@ on several screens.
Name: %{pkg_name}
Version: 0.9.1
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: A tiling window manager
Group: User Interface/X
@@ -30,9 +30,11 @@ License: BSD
URL: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/%{name}
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Source1: xmonad.desktop
+Source1: xmonad-session.desktop
Source2: xmonad-start
-Patch0: xmonad-config-manpage.patch
+Source3: xmonad.desktop
+Source4: README.fedora
+Patch1: xmonad-dynamic-link.patch
# fedora ghc archs:
ExclusiveArch: %{ix86} x86_64 ppc alpha
BuildRequires: ghc, ghc-doc, ghc-prof
@@ -42,8 +44,7 @@ BuildRequires: hscolour
%endif
%{?ghc_pkg_deps:BuildRequires: %{ghc_pkg_deps}, %(echo %{ghc_pkg_deps} | sed -e "s/\(ghc-[^, ]\+\)-devel/\1-doc,\1-prof/g")}
Requires: ghc-%{name}-devel = %{version}-%{release}
-# required until there is a command to open some system default
-# xterminal
+# required until there is a command to open a system-default xterminal
Requires: xterm
# for xmessage
Requires: xorg-x11-apps
@@ -54,7 +55,8 @@ Requires: xorg-x11-apps
%prep
%setup -q
-%patch0 -p1 -b .orig
+%patch1 -p1 -b .orig
+cp -p %SOURCE4 .
%build
@@ -68,7 +70,7 @@ rm -rf $RPM_BUILD_ROOT
install -p -m 0644 -D man/%{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
install -p -m 0644 -D %SOURCE1 $RPM_BUILD_ROOT%{_datadir}/xsessions/%{name}.desktop
install -p -m 0755 -D %SOURCE2 $RPM_BUILD_ROOT%{_bindir}/%{name}-start
-install -p -m 0644 -D man/xmonad.hs $RPM_BUILD_ROOT%{_sysconfdir}/skel/.%{name}/%{name}.hs
+install -p -m 0644 -D %SOURCE3 $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
rm $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/man/xmonad.hs
@@ -79,18 +81,26 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
-%doc CONFIG LICENSE README STYLE TODO man/%{name}.hs.orig
+%doc CONFIG LICENSE README man/%{name}.hs README.fedora
%attr(755,root,root) %{_bindir}/%{name}
%attr(755,root,root) %{_bindir}/%{name}-start
%{_mandir}/man1/%{name}.1*
+%{_datadir}/applications/%{name}.desktop
%{_datadir}/xsessions/%{name}.desktop
-%{_sysconfdir}/skel/.%{name}/%{name}.hs
%ghc_binlib_package -o 0.9.1-5
%changelog
+* Sun Sep 12 2010 Jens Petersen <petersen at redhat.com> - 0.9.1-6
+- add application desktop file for gnome-session to find xmonad
+ so setting /desktop/gnome/session/required_components/windowmanager now works
+- add xmonad-dynamic-link.patch to dynamically link customized xmonad
+- move display of manpage for new users from xmonad.hs to xmonad-start
+ and only display it when no ~/.xmonad/
+- drop skel file and dont create ~/.xmonad by default
+
* Sat Sep 4 2010 Jens Petersen <petersen at redhat.com> - 0.9.1-5
- update to ghc-rpm-macros-0.8.1, hscolour and drop doc pkg (cabal2spec-0.22.2)
More information about the scm-commits
mailing list