forked from mirrors/nixpkgs
systemd-vconsole-setup: Don't put the X server in non-raw mode
‘systemd-vconsole-setup’ by default operates on /dev/tty0, the currently active tty. Since it puts /dev/tty0 in Unicode or ASCII mode, if the X server is currently active when it runs, keys such as Alt-F4 won't reach the X server anymore. So use /dev/tty1 instead.
This commit is contained in:
parent
a4cad32c3d
commit
b4a1893cdd
|
@ -47,11 +47,11 @@ let
|
||||||
The keyboard mapping table for the virtual consoles.
|
The keyboard mapping table for the virtual consoles.
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
glibcLocales = pkgs.glibcLocales.override {
|
glibcLocales = pkgs.glibcLocales.override {
|
||||||
|
|
|
@ -45,7 +45,7 @@ let
|
||||||
# Login stuff.
|
# Login stuff.
|
||||||
"systemd-logind.service"
|
"systemd-logind.service"
|
||||||
"autovt@.service"
|
"autovt@.service"
|
||||||
"systemd-vconsole-setup.service"
|
#"systemd-vconsole-setup.service"
|
||||||
"systemd-user-sessions.service"
|
"systemd-user-sessions.service"
|
||||||
"dbus-org.freedesktop.login1.service"
|
"dbus-org.freedesktop.login1.service"
|
||||||
"user@.service"
|
"user@.service"
|
||||||
|
|
|
@ -13,6 +13,12 @@ let
|
||||||
consoleFont = config.i18n.consoleFont;
|
consoleFont = config.i18n.consoleFont;
|
||||||
consoleKeyMap = config.i18n.consoleKeyMap;
|
consoleKeyMap = config.i18n.consoleKeyMap;
|
||||||
|
|
||||||
|
vconsoleConf = pkgs.writeText "vconsole.conf"
|
||||||
|
''
|
||||||
|
KEYMAP=${consoleKeyMap}
|
||||||
|
FONT=${consoleFont}
|
||||||
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -61,11 +67,27 @@ in
|
||||||
# systemd-vconsole-setup.service if /etc/vconsole.conf changes.
|
# systemd-vconsole-setup.service if /etc/vconsole.conf changes.
|
||||||
environment.etc = singleton
|
environment.etc = singleton
|
||||||
{ target = "vconsole.conf";
|
{ target = "vconsole.conf";
|
||||||
source = pkgs.writeText "vconsole.conf"
|
source = vconsoleConf;
|
||||||
''
|
};
|
||||||
KEYMAP=${consoleKeyMap}
|
|
||||||
FONT=${consoleFont}
|
# This is identical to the systemd-vconsole-setup.service unit
|
||||||
'';
|
# shipped with systemd, except that it uses /dev/tty1 instead of
|
||||||
|
# /dev/tty0 to prevent putting the X server in non-raw mode, and
|
||||||
|
# it has a restart trigger.
|
||||||
|
boot.systemd.services."systemd-vconsole-setup" =
|
||||||
|
{ description = "Setup Virtual Console";
|
||||||
|
before = [ "sysinit.target" "shutdown.target" ];
|
||||||
|
unitConfig =
|
||||||
|
{ DefaultDependencies = "no";
|
||||||
|
Conflicts = "shutdown.target";
|
||||||
|
ConditionPathExists = "/dev/tty1";
|
||||||
|
};
|
||||||
|
serviceConfig =
|
||||||
|
{ Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
ExecStart = "${config.system.build.systemd}/lib/systemd/systemd-vconsole-setup /dev/tty1";
|
||||||
|
};
|
||||||
|
restartTriggers = [ vconsoleConf ];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue