KDM: Add support for extra window & desktop manager.

svn path=/nixos/branches/modular-nixos/; revision=15011
This commit is contained in:
Nicolas Pierron 2009-04-13 10:57:36 +00:00
parent b1e05ed8fa
commit 98eda94473
2 changed files with 19 additions and 2 deletions

View File

@ -6,7 +6,7 @@ let
xorg = cfg.package;
# file provided by services.xserver.displayManager.session.script
xsession = wm: dm: pkgs.writeText "xsession" ''
xsession = wm: dm: pkgs.writeScript "xsession" ''#!/bin/sh
source /etc/profile
@ -67,6 +67,21 @@ let
exit
'';
mkDesktops = names: pkgs.runCommand "desktops" {} ''
ensureDir $out
${concatMapStrings (n: ''
cat - > "$out/${n}.desktop" << EODESKTOP
[Desktop Entry]
Version=1.0
Type=XSession
TryExec=${cfg.displayManager.session.script}
Exec=${cfg.displayManager.session.script} '${n}'
Name=${n}
Comment=
EODESKTOP
'') names}
'';
in
{
@ -138,6 +153,7 @@ in
wm = filter (s: s.manage == "window") list;
dm = filter (s: s.manage == "desktop") list;
names = concatMap (d: map (w: d.name + " + " + w.name) wm) dm;
desktops = mkDesktops names;
script = xsession wm dm;
};
};

View File

@ -31,6 +31,7 @@ let
kdmrc = stdenv.mkDerivation {
name = "kdmrc";
# -e "s|Session=${kdebase_workspace}/share/config/kdm/Xsession|Session=${dmcfg.session.script}|" \
buildCommand = ''
cp ${kdebase_workspace}/share/config/kdm/kdmrc .
sed -i -e "s|#HaltCmd=|HaltCmd=${pkgs.upstart}/sbin/halt|" \
@ -38,7 +39,7 @@ let
-e "s|#Xrdb=|Xrdb=${pkgs.xlibs.xrdb}/bin/xrdb|" \
-e "s|#HiddenUsers=root|HiddenUsers=root,nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10|" \
-e "s|ServerCmd=/FOO/bin/X|ServerCmd=${dmcfg.xserverBin} ${dmcfg.xserverArgs}|" \
-e "s|Session=${kdebase_workspace}/share/config/kdm/Xsession|Session=${dmcfg.session.script}|" \
-e "s|^SessionsDirs=.*$|SessionsDirs=${dmcfg.session.desktops}|" \
-e "s|#FailsafeClient=|FailsafeClient=${pkgs.xterm}/bin/xterm|" \
-e "s|#PluginsLogin=sign|PluginsLogin=${kdebase_workspace}/lib/kde4/kgreet_classic.so|" \
kdmrc