* Start KDE properly. Make sure that some essential packages such as
iceauth are in the system path when we're using KDE. svn path=/nixos/trunk/; revision=8472
This commit is contained in:
parent
603e598a84
commit
9cb9621fec
@ -530,30 +530,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
name = ["services" "xserver" "windowManager"];
|
|
||||||
default = "metacity";
|
|
||||||
description = "
|
|
||||||
This option selects the window manager. Available values are
|
|
||||||
<literal>twm</literal> (extremely primitive),
|
|
||||||
<literal>metacity</literal>, and <literal>compiz</literal>.
|
|
||||||
";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
name = ["services" "xserver" "sessionType"];
|
name = ["services" "xserver" "sessionType"];
|
||||||
default = "gnome";
|
default = "gnome";
|
||||||
example = "xterm";
|
example = "xterm";
|
||||||
description = "
|
description = "
|
||||||
The kind of session to start after login. Current possibilies
|
The kind of session to start after login. Current possibilies
|
||||||
are <literal>gnome</literal> (which starts
|
are <literal>kde</literal> (which starts KDE),
|
||||||
|
<literal>gnome</literal> (which starts
|
||||||
<command>gnome-terminal</command>) and <literal>xterm</literal>
|
<command>gnome-terminal</command>) and <literal>xterm</literal>
|
||||||
(which starts <command>xterm</command>).
|
(which starts <command>xterm</command>).
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
name = ["services" "xserver" "windowManager"];
|
||||||
|
default = "";
|
||||||
|
description = "
|
||||||
|
This option selects the window manager. Available values are
|
||||||
|
<literal>twm</literal> (extremely primitive),
|
||||||
|
<literal>metacity</literal>, and <literal>compiz</literal>. If
|
||||||
|
left empty, the <option>sessionType</option> determines the
|
||||||
|
window manager, e.g., Metacity for Gnome, and
|
||||||
|
<command>kwm</command> for KDE.
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
name = ["services" "xserver" "sessionStarter"];
|
name = ["services" "xserver" "sessionStarter"];
|
||||||
example = "${pkgs.xterm}/bin/xterm -ls";
|
example = "${pkgs.xterm}/bin/xterm -ls";
|
||||||
|
@ -134,7 +134,7 @@ import ../upstart-jobs/gather.nix {
|
|||||||
(import ../upstart-jobs/xserver.nix {
|
(import ../upstart-jobs/xserver.nix {
|
||||||
inherit config;
|
inherit config;
|
||||||
inherit (pkgs) stdenv writeText lib xterm slim xorg mesa
|
inherit (pkgs) stdenv writeText lib xterm slim xorg mesa
|
||||||
gnome compiz feh;
|
gnome compiz feh kdebase kdelibs;
|
||||||
fontDirectories = import ./fonts.nix {inherit pkgs;};
|
fontDirectories = import ./fonts.nix {inherit pkgs;};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -64,6 +64,8 @@ EndSection
|
|||||||
Section "Device"
|
Section "Device"
|
||||||
Identifier "Device[0]"
|
Identifier "Device[0]"
|
||||||
Driver "@videoDriver@"
|
Driver "@videoDriver@"
|
||||||
|
Option "Clone" "On"
|
||||||
|
Option "MonitorLayout" "CRT,LFP"
|
||||||
EndSection
|
EndSection
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{ stdenv, writeText, lib, xorg, mesa, xterm, slim, gnome
|
{ stdenv, writeText, lib, xorg, mesa, xterm, slim, gnome
|
||||||
, compiz, feh
|
, compiz, feh
|
||||||
|
, kdelibs, kdebase
|
||||||
|
|
||||||
, config
|
, config
|
||||||
|
|
||||||
@ -24,7 +25,6 @@ let
|
|||||||
# Get a bunch of user settings.
|
# Get a bunch of user settings.
|
||||||
videoDriver = getCfg "videoDriver";
|
videoDriver = getCfg "videoDriver";
|
||||||
resolutions = map (res: "\"${toString res.x}x${toString res.y}\"") (getCfg "resolutions");
|
resolutions = map (res: "\"${toString res.x}x${toString res.y}\"") (getCfg "resolutions");
|
||||||
windowManager = getCfg "windowManager";
|
|
||||||
sessionType = getCfg "sessionType";
|
sessionType = getCfg "sessionType";
|
||||||
sessionStarter = getCfg "sessionStarter";
|
sessionStarter = getCfg "sessionStarter";
|
||||||
|
|
||||||
@ -36,6 +36,14 @@ let
|
|||||||
abort ("unknown session type "+ sessionType);
|
abort ("unknown session type "+ sessionType);
|
||||||
|
|
||||||
|
|
||||||
|
windowManager =
|
||||||
|
let wm = getCfg "windowManager"; in
|
||||||
|
if wm != "" then wm else
|
||||||
|
if sessionType == "gnome" then "metacity" else
|
||||||
|
if sessionType == "kde" then "none" /* started by startkde */ else
|
||||||
|
"twm";
|
||||||
|
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
xorg.xorgserver
|
xorg.xorgserver
|
||||||
xorg.xf86inputkeyboard
|
xorg.xf86inputkeyboard
|
||||||
@ -75,52 +83,84 @@ let
|
|||||||
|
|
||||||
clientScript = writeText "xclient" "
|
clientScript = writeText "xclient" "
|
||||||
|
|
||||||
|
source /etc/profile
|
||||||
|
|
||||||
exec > $HOME/.Xerrors 2>&1
|
exec > $HOME/.Xerrors 2>&1
|
||||||
|
|
||||||
|
|
||||||
### Start a window manager.
|
### Start a window manager.
|
||||||
|
|
||||||
${if windowManager == "twm" then "
|
${if windowManager == "twm" then "
|
||||||
${xorg.twm}/bin/twm &
|
${xorg.twm}/bin/twm &
|
||||||
"
|
"
|
||||||
|
|
||||||
else if windowManager == "metacity" then "
|
else if windowManager == "metacity" then "
|
||||||
# !!! Hack: load the schemas for Metacity.
|
# !!! Hack: load the schemas for Metacity.
|
||||||
GCONF_CONFIG_SOURCE=xml::~/.gconf ${gnome.GConf}/bin/gconftool-2 \\
|
GCONF_CONFIG_SOURCE=xml::~/.gconf ${gnome.GConf}/bin/gconftool-2 \\
|
||||||
--makefile-install-rule ${gnome.metacity}/etc/gconf/schemas/*.schemas
|
--makefile-install-rule ${gnome.metacity}/etc/gconf/schemas/*.schemas
|
||||||
${gnome.metacity}/bin/metacity &
|
${gnome.metacity}/bin/metacity &
|
||||||
|
"
|
||||||
|
|
||||||
|
else if windowManager == "kwm" then "
|
||||||
|
${kdebase}/bin/kwin &
|
||||||
"
|
"
|
||||||
|
|
||||||
else if windowManager == "compiz" then "
|
else if windowManager == "compiz" then "
|
||||||
|
|
||||||
# !!! Hack: load the schemas for Compiz.
|
# !!! Hack: load the schemas for Compiz.
|
||||||
GCONF_CONFIG_SOURCE=xml::~/.gconf ${gnome.GConf}/bin/gconftool-2 \\
|
GCONF_CONFIG_SOURCE=xml::~/.gconf ${gnome.GConf}/bin/gconftool-2 \\
|
||||||
--makefile-install-rule ${compiz}/etc/gconf/schemas/*.schemas
|
--makefile-install-rule ${compiz}/etc/gconf/schemas/*.schemas
|
||||||
|
|
||||||
# !!! Hack: turn on most Compiz modules.
|
# !!! Hack: turn on most Compiz modules.
|
||||||
${gnome.GConf}/bin/gconftool-2 -t list --list-type=string \\
|
${gnome.GConf}/bin/gconftool-2 -t list --list-type=string \\
|
||||||
--set /apps/compiz/general/allscreens/options/active_plugins \\
|
--set /apps/compiz/general/allscreens/options/active_plugins \\
|
||||||
[gconf,png,decoration,wobbly,fade,minimize,move,resize,cube,switcher,rotate,place,scale,water]
|
[gconf,png,decoration,wobbly,fade,minimize,move,resize,cube,switcher,rotate,place,scale,water]
|
||||||
|
|
||||||
# Start Compiz and the GTK-style window decorator.
|
# Start Compiz and the GTK-style window decorator.
|
||||||
${compiz}/bin/compiz gconf &
|
${compiz}/bin/compiz gconf &
|
||||||
${compiz}/bin/gtk-window-decorator &
|
${compiz}/bin/gtk-window-decorator &
|
||||||
"
|
"
|
||||||
|
|
||||||
else abort ("unknown window manager "+ windowManager)}
|
else if windowManager == "none" then "
|
||||||
|
|
||||||
|
# The session starter will start the window manager.
|
||||||
|
|
||||||
|
"
|
||||||
|
|
||||||
|
else abort ("unknown window manager " + windowManager)}
|
||||||
|
|
||||||
|
|
||||||
### Show a background image.
|
### Show a background image.
|
||||||
if test -e $HOME/.background-image; then
|
# (but not if we're starting a full desktop environment that does it for us)
|
||||||
${feh}/bin/feh --bg-scale $HOME/.background-image
|
${if sessionType != "kde" then "
|
||||||
fi
|
|
||||||
|
if test -e $HOME/.background-image; then
|
||||||
|
${feh}/bin/feh --bg-scale $HOME/.background-image
|
||||||
|
fi
|
||||||
|
|
||||||
|
" else ""}
|
||||||
|
|
||||||
|
|
||||||
### Start a 'session' (right now, this is just a terminal).
|
### Start the session.
|
||||||
# !!! yes, this means that you 'log out' by killing the X server.
|
${if sessionType == "kde" then "
|
||||||
while ${sessionCmd}; do
|
|
||||||
sleep 1
|
# Start KDE.
|
||||||
done
|
export KDEDIRS=${kdebase}:${kdelibs}
|
||||||
|
export XDG_CONFIG_DIRS=${kdebase}/etc/xdg:${kdelibs}/etc/xdg
|
||||||
|
export XDG_DATA_DIRS=${kdebase}/share
|
||||||
|
exec ${kdebase}/bin/startkde
|
||||||
|
|
||||||
|
" else "
|
||||||
|
|
||||||
|
# For all other session types, we currently just start a
|
||||||
|
# terminal of the kind indicated by sessionCmd.
|
||||||
|
# !!! yes, this means that you 'log out' by killing the X server.
|
||||||
|
while ${sessionCmd}; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
"}
|
||||||
|
|
||||||
"; # */ <- hack to fix syntax highlighting
|
"; # */ <- hack to fix syntax highlighting
|
||||||
|
|
||||||
|
|
||||||
@ -170,6 +210,12 @@ rec {
|
|||||||
gnome.gnometerminal
|
gnome.gnometerminal
|
||||||
gnome.GConf
|
gnome.GConf
|
||||||
gnome.gconfeditor
|
gnome.gconfeditor
|
||||||
|
]
|
||||||
|
++ optional (sessionType == "kde") [
|
||||||
|
kdelibs
|
||||||
|
kdebase
|
||||||
|
xorg.iceauth # absolutely required by dcopserver
|
||||||
|
xorg.xset # used by startkde, non-essential
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user