anchor.diff:      pkgs.kdebase
       xorg.xset # used by startkde, non-essential
     ]
  +  ++ optional (sessionType == "kde4") [
  +    xorg.xmessage # so that startkde can show error messages
  +    pkgs.qt4 # needed for qdbus
  +    pkgs.kde42.kdelibs
  +    pkgs.kde42.kdebase
  +    pkgs.kde42.kdebase_runtime
  +    pkgs.kde42.kdebase_workspace
  +    xorg.xset # used by startkde, non-essential
  +  ]
     ++ optional (videoDriver == "nvidia") [
       kernelPackages.nvidiaDrivers
     ];
   
   
     extraEtc =
  -    optional (sessionType == "kde")
  +    optional (sessionType == "kde" || sessionType == "kde4")
         { source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
           target = "X11/xkb";
         }
  
positive.code:       export XDG_CONFIG_DIRS=${pkgs.kdebase}/etc/xdg:${pkgs.kdelibs}/etc/xdg
        export XDG_DATA_DIRS=${pkgs.kdebase}/share
        exec ${pkgs.kdebase}/bin/startkde
  
      '' else ''
  
  
negative.code:     if wm != "" then wm else
      if sessionType == "gnome" then "metacity" else
      if sessionType == "kde" then "none" /* started by startkde */ else
      if sessionType == "kde4" then "none" /* started by startkde */ else
      "twm";
  
      
  