nixos/x11: start session with dbus-launch
This is needed by most window managers. Desktop environments usually launch dbus-launch if a session hasn't been started yet so this shouldn't hurt. The worst it can happen is that one dbus session will be unused in case it's started twice. The GDM change is backported from recent gdm.
This commit is contained in:
@@ -50,6 +50,12 @@ let
|
||||
exec > ~/.xsession-errors 2>&1
|
||||
''}
|
||||
|
||||
${optionalString cfg.startDbusSession ''
|
||||
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
|
||||
exec ${pkgs.dbus.tools}/bin/dbus-launch --exit-with-session "$0" "$sessionType"
|
||||
fi
|
||||
''}
|
||||
|
||||
${optionalString cfg.displayManager.desktopManagerHandlesLidAndPower ''
|
||||
# Stop systemd from handling the power button and lid switch,
|
||||
# since presumably the desktop environment will handle these.
|
||||
|
||||
@@ -238,6 +238,14 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
startDbusSession = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to start a new DBus session when you log in with dbus-launch.
|
||||
'';
|
||||
};
|
||||
|
||||
layout = mkOption {
|
||||
type = types.str;
|
||||
default = "us";
|
||||
|
||||
Reference in New Issue
Block a user