complete-computing-environment/custom-keyboard-layout.org

61 lines
2.0 KiB
Org Mode

:PROPERTIES:
:ID: 20210814224010-my_custom_keyboard_layout
:ROAM_ALIASES: xmodmap "My Xmodmap Hacks"
:END:
#+title: My Custom Keyboard Layout
#+ARCOLOGY_KEY: cce/xkb-layout
#+ARCOLOGY_ALLOW_CRAWL: t
#+ARROYO_NIXOS_MODULE: nixos/xmodmap.nix
#+ARROYO_SYSTEM_ROLE: endpoint
#+AUTO_TANGLE: t
It seems silly to me that such "valuable" keyboard real-estate on the default QWERTY is left to =<>=; I rebind them instead to =!?= and shift things around to fill the gaps:
- Shift + comma produces an exclamation point
- Shift + period produces a question mark
- Shift + slash produces a backslash
- Shift + 1 produces a less-than mark
- Shift + backslash produces a greater-than mark
On my custom keyboards, these are put in reasonable places, hitting Shift + NUMBER is not something I am looking to do, as I have a dedicated symbol layer. This isn't universal, however. By default, Shift + Backslash produces a pipe character, which is also in my [[id:cce/keyboardio_atreus][Keyboardio Atreus]]'s symbol layer.
#+begin_src nix :tangle ~/arroyo-nix/nixos/xmodmap.nix
{ pkgs, ... }:
let
punctFile = pkgs.writeText "punctuations.xkb" ''
default partial alphanumeric_keys modifier_keys
xkb_symbols "rr_punctuations" {
include "pc+us(basic)+inet(evdev)"
name[Group1]= "US ASCII, punctuation swap";
key <AE01> {[ 1, less ]};
key <BKSL> {[ bar, greater ]};
key <AB08> {[ comma, exclam ]};
key <AB09> {[ period, question ]};
key <AB10> {[ slash, backslash ]};
};
'';
in {
# load shift-sign changes
# services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY";
services.xserver.xkb = {
model = "pc104";
layout = "punctual";
# xkbVariant = "";
# options = "ctrl:nocaps";
extraLayouts = {
punctual = {
description = "Shift ,. become !?";
languages = [ "eng" ];
symbolsFile = punctFile;
};
};
};
console.useXkbConfig = true;
}
#+end_src