- 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
This commit is contained in:
Jens Petersen 2010-09-12 22:42:04 +10:00 committed by Jens Petersen
parent 80c47925c1
commit ae8d5aeaef
7 changed files with 101 additions and 33 deletions

48
README.fedora Normal file
View File

@ -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

View File

@ -1,13 +0,0 @@
diff -r -u -X /home/yankee/Projekten/fedora-devshell/diff.excludes xmonad-0.8.1_orig/man/xmonad.hs xmonad-0.8.1/man/xmonad.hs
--- xmonad-0.8.1_orig/man/xmonad.hs 2009-01-16 17:47:27.000000000 -0500
+++ xmonad-0.8.1/man/xmonad.hs 2009-04-27 18:31:12.195829219 -0400
@@ -246,7 +246,8 @@
-- Run xmonad with the settings you specify. No need to modify this.
--
-main = xmonad defaults
+main = do spawn "xterm -e '/usr/bin/man xmonad'"
+ xmonad defaults
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will

12
xmonad-dynamic-link.patch Normal file
View File

@ -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:

11
xmonad-session.desktop Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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@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@redhat.com> - 0.9.1-5
- update to ghc-rpm-macros-0.8.1, hscolour and drop doc pkg (cabal2spec-0.22.2)