From fb50c670b45393c80192c05072eaeadaa637215d Mon Sep 17 00:00:00 2001 From: sils Date: Sat, 17 Dec 2022 16:29:41 +0100 Subject: keyboard layout --- configuration.nix | 1 + files/neoqwertz.xkb | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++ keyboard.nix | 26 +++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 files/neoqwertz.xkb create mode 100644 keyboard.nix diff --git a/configuration.nix b/configuration.nix index 7a5df46..26c138e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -14,6 +14,7 @@ ./cups.nix ./args.nix ./zsh.nix + ./keyboard.nix ]; system.stateVersion = "23.05"; } diff --git a/files/neoqwertz.xkb b/files/neoqwertz.xkb new file mode 100644 index 0000000..40de951 --- /dev/null +++ b/files/neoqwertz.xkb @@ -0,0 +1,91 @@ +// NEOQWERTZ keyboard layout +// +// (c) 2016 by Andreas Hofmann +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +xkb_keymap { + xkb_keycodes { include "evdev+aliases(qwertz)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + partial alphanumeric_keys modifier_keys keypad_keys + xkb_symbols { + include "inet(evdev)" + include "pc" + + include "de(neo_base)" + name[Group1]="German (eliminate dead keys with advanced NEO layers)"; + + key { [ asciicircum, degree ] }; + key { [ 1, exclam ] }; + key { [ 2, quotedbl ] }; + key { [ 3, section ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, ampersand ] }; + key { [ 7, slash ], [ braceleft ] }; + key { [ 8, parenleft ], [ bracketleft ] }; + key { [ 9, parenright ], [ bracketright ] }; + key { [ 0, equal ], [ braceright ] }; + key { [ ssharp, question ], [ backslash ] }; + key { [ acute, grave ] }; + + key { [ q, Q ], [ at ] }; + key { [ w, W ], [ NoSymbol ] }; + key { [ e, E ], [ EuroSign ] }; + key { [ r, R ], [ NoSymbol ] }; + key { [ t, T ] }; + key { [ z, Z ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ udiaeresis, Udiaeresis ] }; + key { [ a, A ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ odiaeresis, Odiaeresis ] }; + key { [ adiaeresis, Adiaeresis ] }; + key { [ y, Y ] }; + key { [ x, X ] }; + key { [ c, C ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M ] }; + + key { [ comma, semicolon ] }; + key { [ period, colon ] }; + key { [ minus, underscore ] }; + key { [ plus, asterisk ], [ asciitilde ] }; + + include "shift(both_capslock)" + include "level3(caps_switch)" + include "level3(bksl_switch)" + include "level5(lsgt_switch)" + include "level5(ralt_switch)" + + modifier_map Control{ Control_L }; + + key.type = "ONE_LEVEL"; + key { [ ISO_Group_Latch ] }; + }; + xkb_geometry { include "pc(pc105)" }; +}; diff --git a/keyboard.nix b/keyboard.nix new file mode 100644 index 0000000..be64815 --- /dev/null +++ b/keyboard.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: + + let + compiledLayout = pkgs.runCommand "keyboard-layout" {} '' + ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./files/neoqwertz.xkb} $out + ''; + in +{ + #services.xserver = { + # layout = "de, de"; + # xkbVariant = ",neo"; + # xkbOptions = "grp:win_space_toggle"; + #}; + + environment.systemPackages = [ pkgs.xorg.xkbcomp ]; + services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY"; + + i18n.defaultLocale = "en_US.UTF-8"; + + console = { + font = "Lat2-Terminus16"; + #keyMap = "de"; + useXkbConfig = true; # use xkbOptions in tty. + }; +} + -- cgit 1.4.1