mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
nix: make layouts a nixosModule
This commit is contained in:
parent
42e1a9d759
commit
075ba6c976
6 changed files with 9 additions and 5 deletions
39
nix/nixosModules/layouts/README.md
Normal file
39
nix/nixosModules/layouts/README.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
This folder contains my very awesome dvorak French layout on linux
|
||||
|
||||
# Ubuntu
|
||||
`$XDG_CONFIG_HOME/.config/xkb` doesn't work.
|
||||
[source](https://github.com/elias19r/xkb-layouts)
|
||||
|
||||
`# cp dvorak-french.xkb /usr/share/X11/xkb/symbols/`
|
||||
|
||||
`/usr/share/X11/xkb/rules/evdev.xml`
|
||||
```xml
|
||||
<layoutList>
|
||||
...
|
||||
<layout>
|
||||
<configItem>
|
||||
<name>dvorak-french</name>
|
||||
<shortDescription>Baguette</shortDescription>
|
||||
<description>French Dvorak</description>
|
||||
</configItem>
|
||||
</layout>
|
||||
...
|
||||
</layoutList>
|
||||
```
|
||||
|
||||
`/usr/share/X11/xkb/rules/evdev.lst`
|
||||
```xml
|
||||
! layout
|
||||
dvorak-french French Dvorak
|
||||
```
|
||||
|
||||
## Swap escape and capslock
|
||||
`dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:swapescape']"`
|
||||
(to undo, use `dconf reset`)
|
||||
|
||||
# Notes
|
||||
Use `setxkbmap -option caps:swapescape` to swap escape and capslock
|
||||
[source](https://askubuntu.com/a/830343)
|
||||
|
||||
## Sources
|
||||
https://help.ubuntu.com/community/Custom%20keyboard%20layout%20definitions
|
||||
19
nix/nixosModules/layouts/default.nix
Normal file
19
nix/nixosModules/layouts/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
services.xserver.xkb = {
|
||||
layout = "myDvorak";
|
||||
options = "caps:swapescape";
|
||||
extraLayouts = {
|
||||
"myDvorak" = {
|
||||
languages = [ "us" ];
|
||||
symbolsFile = ./dvorak.xkb;
|
||||
description = "Leana's dvorak";
|
||||
};
|
||||
"myDvorakFrench" = {
|
||||
languages = [ "fr" ];
|
||||
symbolsFile = ./dvorak-french.xkb;
|
||||
description = "Leana's dvorak but baguette";
|
||||
};
|
||||
};
|
||||
};
|
||||
console.useXkbConfig = true;
|
||||
}
|
||||
58
nix/nixosModules/layouts/dvorak-french.xkb
Normal file
58
nix/nixosModules/layouts/dvorak-french.xkb
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// vim:syntax=xkb
|
||||
|
||||
partial alphanumeric_keys
|
||||
xkb_symbols "dvorak-french" {
|
||||
|
||||
name[Group1]= "French Dvorak";
|
||||
|
||||
key <TLDE> {[ grave, asciitilde, dead_grave, dead_tilde ]};
|
||||
key <AE01> {[ VoidSymbol, exclam ]};
|
||||
key <AE02> {[ egrave, at ]};
|
||||
key <AE03> {[ eacute, numbersign ]};
|
||||
key <AE04> {[ U22c5, dollar ]};
|
||||
key <AE05> {[ oe, percent ]};
|
||||
key <AE06> {[ dead_diaeresis, asciicircum ]};
|
||||
key <AE07> {[ dead_circumflex, ampersand ]};
|
||||
key <AE08> {[ ccedilla, asterisk, Ccedilla ]};
|
||||
key <AE09> {[ agrave, parenleft, dead_grave, dead_breve ]};
|
||||
key <AE10> {[ ugrave, parenright, U00ba ]};
|
||||
key <AE11> {[ bracketleft, braceleft ]};
|
||||
key <AE12> {[ bracketright, braceright, dead_tilde ]};
|
||||
|
||||
key <AD01> {[apostrophe, quotedbl, dead_acute, dead_diaeresis ]};
|
||||
key <AD02> {[ comma, less, dead_cedilla, dead_caron ]};
|
||||
key <AD03> {[ period, greater, dead_abovedot, periodcentered ]};
|
||||
key <AD04> {[ p, P ]};
|
||||
key <AD05> {[ y, Y ]};
|
||||
key <AD06> {[ f, F ]};
|
||||
key <AD07> {[ g, G ]};
|
||||
key <AD08> {[ c, C ]};
|
||||
key <AD09> {[ r, R ]};
|
||||
key <AD10> {[ l, L ]};
|
||||
key <AD11> {[ slash, question ]};
|
||||
key <AD12> {[ equal, plus ]};
|
||||
key <AC01> {[ a, A ]};
|
||||
key <AC02> {[ o, O ]};
|
||||
key <AC03> {[ e, E ]};
|
||||
key <AC04> {[ u, U ]};
|
||||
key <AC05> {[ i, I ]};
|
||||
key <AC06> {[ d, D ]};
|
||||
key <AC07> {[ h, H ]};
|
||||
key <AC08> {[ t, T ]};
|
||||
key <AC09> {[ n, N ]};
|
||||
key <AC10> {[ s, S ]};
|
||||
key <AC11> {[ minus, underscore ]};
|
||||
key <BKSL> {[ backslash, bar ]};
|
||||
|
||||
key <AB01> {[ semicolon, colon, dead_ogonek, dead_doubleacute ]};
|
||||
key <AB02> {[ q, Q ]};
|
||||
key <AB03> {[ j, J ]};
|
||||
key <AB04> {[ k, K ]};
|
||||
key <AB05> {[ x, X ]};
|
||||
key <AB06> {[ b, B ]};
|
||||
key <AB07> {[ m, M ]};
|
||||
key <AB08> {[ w, W ]};
|
||||
key <AB09> {[ v, V ]};
|
||||
key <AB10> {[ z, Z ]};
|
||||
|
||||
};
|
||||
58
nix/nixosModules/layouts/dvorak.xkb
Normal file
58
nix/nixosModules/layouts/dvorak.xkb
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// vim:syntax=xkb
|
||||
|
||||
partial alphanumeric_keys
|
||||
xkb_symbols "dvorak" {
|
||||
|
||||
name[Group1]= "English (Dvorak)";
|
||||
|
||||
key <TLDE> {[ grave, asciitilde, dead_grave, dead_tilde ]};
|
||||
key <AE01> {[ 1, exclam ]};
|
||||
key <AE02> {[ 2, at ]};
|
||||
key <AE03> {[ 3, numbersign ]};
|
||||
key <AE04> {[ 4, dollar ]};
|
||||
key <AE05> {[ 5, percent ]};
|
||||
key <AE06> {[ 6, asciicircum, dead_circumflex, dead_circumflex ]};
|
||||
key <AE07> {[ 7, ampersand ]};
|
||||
key <AE08> {[ 8, asterisk ]};
|
||||
key <AE09> {[ 9, parenleft, dead_grave, dead_breve ]};
|
||||
key <AE10> {[ 0, parenright ]};
|
||||
key <AE11> {[ bracketleft, braceleft ]};
|
||||
key <AE12> {[bracketright, braceright, dead_tilde]};
|
||||
|
||||
key <AD01> {[apostrophe, quotedbl, dead_acute, dead_diaeresis ]};
|
||||
key <AD02> {[ comma, less, dead_cedilla, dead_caron ]};
|
||||
key <AD03> {[ period, greater, dead_abovedot, periodcentered ]};
|
||||
key <AD04> {[ p, P ]};
|
||||
key <AD05> {[ y, Y ]};
|
||||
key <AD06> {[ f, F ]};
|
||||
key <AD07> {[ g, G ]};
|
||||
key <AD08> {[ c, C ]};
|
||||
key <AD09> {[ r, R ]};
|
||||
key <AD10> {[ l, L ]};
|
||||
key <AD11> {[ slash, question ]};
|
||||
key <AD12> {[ equal, plus ]};
|
||||
|
||||
key <AC01> {[ a, A ]};
|
||||
key <AC02> {[ o, O ]};
|
||||
key <AC03> {[ e, E ]};
|
||||
key <AC04> {[ u, U ]};
|
||||
key <AC05> {[ i, I ]};
|
||||
key <AC06> {[ d, D ]};
|
||||
key <AC07> {[ h, H ]};
|
||||
key <AC08> {[ t, T ]};
|
||||
key <AC09> {[ n, N ]};
|
||||
key <AC10> {[ s, S ]};
|
||||
key <AC11> {[ minus, underscore ]};
|
||||
key <BKSL> {[ backslash, bar ]};
|
||||
|
||||
key <AB01> {[ semicolon, colon, dead_ogonek, dead_doubleacute ]};
|
||||
key <AB02> {[ q, Q ]};
|
||||
key <AB03> {[ j, J ]};
|
||||
key <AB04> {[ k, K ]};
|
||||
key <AB05> {[ x, X ]};
|
||||
key <AB06> {[ b, B ]};
|
||||
key <AB07> {[ m, M ]};
|
||||
key <AB08> {[ w, W ]};
|
||||
key <AB09> {[ v, V ]};
|
||||
key <AB10> {[ z, Z ]};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue