From 5e703a65c0867192cb58840727caa4ef9d631267 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Fri, 7 Feb 2025 17:42:10 +0100 Subject: [PATCH] tidy up keyboard key swap --- hardware/keyboard.md | 65 ++++++++++++++++++++++++++ hardware/keyboard/keyboard.md | 68 ---------------------------- hardware/keyboard/unicode-characters | 37 --------------- 3 files changed, 65 insertions(+), 105 deletions(-) create mode 100644 hardware/keyboard.md delete mode 100644 hardware/keyboard/keyboard.md delete mode 100644 hardware/keyboard/unicode-characters diff --git a/hardware/keyboard.md b/hardware/keyboard.md new file mode 100644 index 0000000..4f93722 --- /dev/null +++ b/hardware/keyboard.md @@ -0,0 +1,65 @@ +--- +title: "keyboard" +tags: [ "Documentation", "keyboard", "vim" ] +--- + +# System-Wide Capslock and Escape Swap + +This works everywhere, including in a bare-ass tty. + +Select a keymap, and create a new custom map. + +```bash +su root + +basemap=/usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz +newmap=/usr/share/kbd/keymaps/custom.map.gz + +gunzip -c $basemap | \ + sed 's/Caps_Lock/\n/g;s/Escape/Caps_Lock/g;s/\n/Escape/g' | \ + gzip > $newmap +``` + +Tell the system to use this keymap at startup by naming it in the `rc.conf` file: + +```bash +echo "KEYMAP=$newmap" >> /etc/rc.conf + +cat /etc/rc.conf +reboot +``` + +# Set Layout with X Display + +Set layout to British English. + +```bash +setxkbmap -layout gb +``` + +Or Polish with: + +```bash +setxkbmap -layout pl +``` + +| Language | short | +|:--------|:------| +| Polish | pl | +| Serbian | rs | + +Set 'alt + shift', as the command which cycles through the British English, Polish and Serbian keyboard layout. + +```bash +setxkbmap -layout gb,pl,rs -option grp:alt_shift_toggle +``` + +## Alt_GR + +Remap, e.g., the right Windows key, to Alt_Gr. + +``` + key {[ ISO_Level3_Shift ]}; +``` + + diff --git a/hardware/keyboard/keyboard.md b/hardware/keyboard/keyboard.md deleted file mode 100644 index fc17ca1..0000000 --- a/hardware/keyboard/keyboard.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: "keyboard" -tags: [ "Documentation", "keyboard" ] ---- -# Set Layout with X Display - -Set layout to British English. - -```bash -setxkbmap -layout gb -``` - -Or Polish with: - -```bash -setxkbmap -layout pl -``` - -| Language | short | -|:--------|:------| -| Polish | pl | -| Serbian | rs | - -Set 'alt + shift', as the command which cycles through the British English, Polish and Serbian keyboard layout. - -```bash -setxkbmap -layout gb,pl,rs -option grp:alt_shift_toggle -``` - -## Alt_GR - -Remap, e.g., the right Windows key, to Alt_Gr. - -``` - key {[ ISO_Level3_Shift ]}; -``` - -# Set TTY Keymap - -Copy your keymap, e.g. if it's polish-1, then: - -```bash -cp /usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz /usr/share/kbd/keymaps/*custom*.map.gz -``` - -Then change that map: - -```bash -sudo vim /usr/share/kbd/keymaps/custom.map.gz -``` - ---- - -You can switch Escape and Caps Lock with a single line: - -```bash -sudo sh -c "gunzip -c /usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz | sed 's/ Escape/ PLACEHOLDER/ ; s/Caps_Lock/Escape/g ; s/PLACEHOLDER/Caps_Lock/' | gzip > /usr/share/kbd/keymaps/custom.map.gz" -``` - ---- - -Change the default keyboard mapping to the custom map: - -```bash -echo 'KEYMAP="/usr/share/kbd/keymaps/*custom*.map.gz"' | sudo tee /etc/vconsole.conf -``` - -Reboot to have changes take effect. diff --git a/hardware/keyboard/unicode-characters b/hardware/keyboard/unicode-characters deleted file mode 100644 index f8c1396..0000000 --- a/hardware/keyboard/unicode-characters +++ /dev/null @@ -1,37 +0,0 @@ - ☢ ☣ s ☠ ⚠ - radioactive sign biohazard sign skull and crossbones warning sign - ☤ ⚕ ⚚ † - caduceus staff of aesculapius staff of hermes dagger - ☯ ⚖ ☮ ⚘ - yin yang scales peace flower - ⚔ ☭ ⚒ ⚓ - crossed swords hammer and sickle hammer and pick anchor - ⚛ ⚜ ⚡ ⚶ - atom symbol fleur-de-lis lightning vesta - ☥ ✠ ✙ ✞ - ankh cross cross cross - ✟ ✧ ⋆ ★ - cross diamond star star - ☆ ✪ ✫ ✬ - star star star star - ✭ ✮ ✯ ✰ - star star star star -≪ - ☸ ✵ ❂ ☘ - wheel of dharma star sun shamrock - ♡ ♥ ❤ ⚘ - heart heart big heart flower - ❀ ❃ ❁ ✼ - flower flower flower flower - ☀ ✌ ♫ ♪ - sun V sign music note / melody music note / melody - ☃ ❄ ❅ ❆ - snowman snowflake snowflake snowflake - ☕ ☂ ❦ ✈ - cofee umbrella floral heart / leaf airplane - ♕ ♛ ♖ ♜ -white king / crown black king / crown white rook / tower black rook / tower - ☁ ☾ - cloud waning crescent moon - -