how to set custom xkb_keymap in nixos
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have following layout layouts/en_ru
xkb_keymap
xkb_keycodes include "evdev+aliases(qwerty)" ;
xkb_geometry include "pc(pc104)" ;
xkb_types include "complete" ;
xkb_compat include "complete" ;
xkb_symbols
include "pc+us+ru:2+inet(evdev)"
include "group(rctrl_rshift_toggle)"
include "capslock(swapescape)"
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
// helpers //
// xinput list
// xinput test 16
// xkbcomp $DISPLAY out.xkb
// cat /usr/share/X11/xkb/rules/base.lst
;
;
which is loaded in $HOME/xinitrc
like this
xkbcomp $HOME/.config/layouts/en_ru $DISPLAY
How to move all this to configuration.nix
?
I have made first part of this happen by adding
xserver =
enable = true;
layout = "us,ru";
xkbOptions = "caps:swapescape,grp:rctrl_rshift_toggle";
;
to my configuration.nix
, but I don't know how to add this part and make it system wide
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
nixos
add a comment |Â
up vote
2
down vote
favorite
I have following layout layouts/en_ru
xkb_keymap
xkb_keycodes include "evdev+aliases(qwerty)" ;
xkb_geometry include "pc(pc104)" ;
xkb_types include "complete" ;
xkb_compat include "complete" ;
xkb_symbols
include "pc+us+ru:2+inet(evdev)"
include "group(rctrl_rshift_toggle)"
include "capslock(swapescape)"
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
// helpers //
// xinput list
// xinput test 16
// xkbcomp $DISPLAY out.xkb
// cat /usr/share/X11/xkb/rules/base.lst
;
;
which is loaded in $HOME/xinitrc
like this
xkbcomp $HOME/.config/layouts/en_ru $DISPLAY
How to move all this to configuration.nix
?
I have made first part of this happen by adding
xserver =
enable = true;
layout = "us,ru";
xkbOptions = "caps:swapescape,grp:rctrl_rshift_toggle";
;
to my configuration.nix
, but I don't know how to add this part and make it system wide
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
nixos
1
my first thought is that your swap-Ralt-Lctrl portion is a fairly simple new option to create. the swap-in-us-layout is less so. if altering the system xkb database on nixos is like most linuxes, here's how to make a new option: askubuntu.com/a/969232/669043 ... but i suspect it's a little more like implementing that sort of change as a local patch to a source package that then gets compiled for your particular system, and that's beyond my experience. if you can figure that out, you'd just add your new option to yourxkbOptions
line like any other option.
â quixotic
Oct 29 '17 at 13:04
1
the swap-in-us-layout probably would need to be added as a separate variant (theoretically it could simplyinclude us
and then do yourreplace key
-- without the cyrillic symbols -- see/usr/share/X11/xkb/symbols/us
for examples). then instead oflayout = "us,ru"
you'd specifylayout = "us-myvariant,ru"
.
â quixotic
Oct 29 '17 at 13:09
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have following layout layouts/en_ru
xkb_keymap
xkb_keycodes include "evdev+aliases(qwerty)" ;
xkb_geometry include "pc(pc104)" ;
xkb_types include "complete" ;
xkb_compat include "complete" ;
xkb_symbols
include "pc+us+ru:2+inet(evdev)"
include "group(rctrl_rshift_toggle)"
include "capslock(swapescape)"
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
// helpers //
// xinput list
// xinput test 16
// xkbcomp $DISPLAY out.xkb
// cat /usr/share/X11/xkb/rules/base.lst
;
;
which is loaded in $HOME/xinitrc
like this
xkbcomp $HOME/.config/layouts/en_ru $DISPLAY
How to move all this to configuration.nix
?
I have made first part of this happen by adding
xserver =
enable = true;
layout = "us,ru";
xkbOptions = "caps:swapescape,grp:rctrl_rshift_toggle";
;
to my configuration.nix
, but I don't know how to add this part and make it system wide
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
nixos
I have following layout layouts/en_ru
xkb_keymap
xkb_keycodes include "evdev+aliases(qwerty)" ;
xkb_geometry include "pc(pc104)" ;
xkb_types include "complete" ;
xkb_compat include "complete" ;
xkb_symbols
include "pc+us+ru:2+inet(evdev)"
include "group(rctrl_rshift_toggle)"
include "capslock(swapescape)"
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
// helpers //
// xinput list
// xinput test 16
// xkbcomp $DISPLAY out.xkb
// cat /usr/share/X11/xkb/rules/base.lst
;
;
which is loaded in $HOME/xinitrc
like this
xkbcomp $HOME/.config/layouts/en_ru $DISPLAY
How to move all this to configuration.nix
?
I have made first part of this happen by adding
xserver =
enable = true;
layout = "us,ru";
xkbOptions = "caps:swapescape,grp:rctrl_rshift_toggle";
;
to my configuration.nix
, but I don't know how to add this part and make it system wide
// swap right alt and left control
replace key <RALT> [ Control_L ] ;
modifier_map Control <RALT> ;
// swap ; and : only in us layout
replace key <AC10> [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] ;
nixos
edited Oct 29 '17 at 12:04
asked Oct 29 '17 at 9:37
srghma
1296
1296
1
my first thought is that your swap-Ralt-Lctrl portion is a fairly simple new option to create. the swap-in-us-layout is less so. if altering the system xkb database on nixos is like most linuxes, here's how to make a new option: askubuntu.com/a/969232/669043 ... but i suspect it's a little more like implementing that sort of change as a local patch to a source package that then gets compiled for your particular system, and that's beyond my experience. if you can figure that out, you'd just add your new option to yourxkbOptions
line like any other option.
â quixotic
Oct 29 '17 at 13:04
1
the swap-in-us-layout probably would need to be added as a separate variant (theoretically it could simplyinclude us
and then do yourreplace key
-- without the cyrillic symbols -- see/usr/share/X11/xkb/symbols/us
for examples). then instead oflayout = "us,ru"
you'd specifylayout = "us-myvariant,ru"
.
â quixotic
Oct 29 '17 at 13:09
add a comment |Â
1
my first thought is that your swap-Ralt-Lctrl portion is a fairly simple new option to create. the swap-in-us-layout is less so. if altering the system xkb database on nixos is like most linuxes, here's how to make a new option: askubuntu.com/a/969232/669043 ... but i suspect it's a little more like implementing that sort of change as a local patch to a source package that then gets compiled for your particular system, and that's beyond my experience. if you can figure that out, you'd just add your new option to yourxkbOptions
line like any other option.
â quixotic
Oct 29 '17 at 13:04
1
the swap-in-us-layout probably would need to be added as a separate variant (theoretically it could simplyinclude us
and then do yourreplace key
-- without the cyrillic symbols -- see/usr/share/X11/xkb/symbols/us
for examples). then instead oflayout = "us,ru"
you'd specifylayout = "us-myvariant,ru"
.
â quixotic
Oct 29 '17 at 13:09
1
1
my first thought is that your swap-Ralt-Lctrl portion is a fairly simple new option to create. the swap-in-us-layout is less so. if altering the system xkb database on nixos is like most linuxes, here's how to make a new option: askubuntu.com/a/969232/669043 ... but i suspect it's a little more like implementing that sort of change as a local patch to a source package that then gets compiled for your particular system, and that's beyond my experience. if you can figure that out, you'd just add your new option to your
xkbOptions
line like any other option.â quixotic
Oct 29 '17 at 13:04
my first thought is that your swap-Ralt-Lctrl portion is a fairly simple new option to create. the swap-in-us-layout is less so. if altering the system xkb database on nixos is like most linuxes, here's how to make a new option: askubuntu.com/a/969232/669043 ... but i suspect it's a little more like implementing that sort of change as a local patch to a source package that then gets compiled for your particular system, and that's beyond my experience. if you can figure that out, you'd just add your new option to your
xkbOptions
line like any other option.â quixotic
Oct 29 '17 at 13:04
1
1
the swap-in-us-layout probably would need to be added as a separate variant (theoretically it could simply
include us
and then do your replace key
-- without the cyrillic symbols -- see /usr/share/X11/xkb/symbols/us
for examples). then instead of layout = "us,ru"
you'd specify layout = "us-myvariant,ru"
.â quixotic
Oct 29 '17 at 13:09
the swap-in-us-layout probably would need to be added as a separate variant (theoretically it could simply
include us
and then do your replace key
-- without the cyrillic symbols -- see /usr/share/X11/xkb/symbols/us
for examples). then instead of layout = "us,ru"
you'd specify layout = "us-myvariant,ru"
.â quixotic
Oct 29 '17 at 13:09
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401185%2fhow-to-set-custom-xkb-keymap-in-nixos%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
my first thought is that your swap-Ralt-Lctrl portion is a fairly simple new option to create. the swap-in-us-layout is less so. if altering the system xkb database on nixos is like most linuxes, here's how to make a new option: askubuntu.com/a/969232/669043 ... but i suspect it's a little more like implementing that sort of change as a local patch to a source package that then gets compiled for your particular system, and that's beyond my experience. if you can figure that out, you'd just add your new option to your
xkbOptions
line like any other option.â quixotic
Oct 29 '17 at 13:04
1
the swap-in-us-layout probably would need to be added as a separate variant (theoretically it could simply
include us
and then do yourreplace key
-- without the cyrillic symbols -- see/usr/share/X11/xkb/symbols/us
for examples). then instead oflayout = "us,ru"
you'd specifylayout = "us-myvariant,ru"
.â quixotic
Oct 29 '17 at 13:09