From 98eda9447392a29862d5b86fe10fc88bc74ed1c2 Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Mon, 13 Apr 2009 10:57:36 +0000 Subject: [PATCH] KDM: Add support for extra window & desktop manager. svn path=/nixos/branches/modular-nixos/; revision=15011 --- .../xserver/displayManager/default.nix | 18 +++++++++++++++++- upstart-jobs/xserver/displayManager/kdm.nix | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/upstart-jobs/xserver/displayManager/default.nix b/upstart-jobs/xserver/displayManager/default.nix index f7734c96aaac..af77247f6e61 100644 --- a/upstart-jobs/xserver/displayManager/default.nix +++ b/upstart-jobs/xserver/displayManager/default.nix @@ -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; }; }; diff --git a/upstart-jobs/xserver/displayManager/kdm.nix b/upstart-jobs/xserver/displayManager/kdm.nix index 38ab01c4c3c4..556519472e38 100644 --- a/upstart-jobs/xserver/displayManager/kdm.nix +++ b/upstart-jobs/xserver/displayManager/kdm.nix @@ -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