From 2cf1edf3656c2eecf88613060557ffaffcde796d Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 24 Sep 2007 09:19:34 +0000 Subject: [PATCH] Added language switch support to xserver.nix svn path=/nixos/trunk/; revision=9367 --- system/options.nix | 18 +++++++++++++++++- upstart-jobs/xserver.conf | 3 ++- upstart-jobs/xserver.nix | 5 +++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/system/options.nix b/system/options.nix index ae4c30c9c06..5971f10d20e 100644 --- a/system/options.nix +++ b/system/options.nix @@ -702,7 +702,23 @@ Event device for Synaptics touchpad. "; } - + + { + name = ["services" "xserver" "layout"]; + default = "us"; + description =" + Keyboard layout. + "; + } + + { + name = ["services" "xserver" "xkbOptions"]; + default = ""; + example = "grp:caps_toggle, grp_led:scroll"; + description =" + X keyboard options; layout switching goes here. + "; + } { diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index 58618a8fd9e..0a801217888 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -27,9 +27,10 @@ Section "InputDevice" Driver "kbd" Identifier "Keyboard[0]" Option "Protocol" "Standard" - Option "XkbLayout" "us" + Option "XkbLayout" "@layout@" Option "XkbModel" "pc104" Option "XkbRules" "xfree86" + @xkbOptions@ EndSection diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index ff4532b778f..d77d5c04f70 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -98,6 +98,11 @@ let Option \"TapButton3\" \"3\" EndSection " else ""); + xkbOptions = (if (getCfg "xkbOptions") == "" then "" else + " Option \"XkbOptions\" \""+(getCfg "xkbOptions")+"\""); + + layout = getCfg "layout"; + corePointer = (if getCfg "isSynaptics" then "Touchpad[0]" else "Mouse[0]");