From ae8d5aeaef5d663e7c8bfb459dc6619b53be45fa Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sun, 12 Sep 2010 22:42:04 +1000 Subject: [PATCH] - 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(-) create mode 100644 README.fedora delete mode 100644 xmonad-config-manpage.patch create mode 100644 xmonad-dynamic-link.patch create mode 100644 xmonad-session.desktop 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 < 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 - 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 - 0.9.1-5 - update to ghc-rpm-macros-0.8.1, hscolour and drop doc pkg (cabal2spec-0.22.2)