From f8c21a40143fd30eaaba7d2acaf5aef9bfbc5d28 Mon Sep 17 00:00:00 2001
From: Malin Freeborn <malinfreeborn@posteo.net>
Date: Sat, 10 Dec 2022 08:02:21 +0100
Subject: [PATCH] remap key as one-liner

---
 hardware/keyboard/keyboard.md | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/hardware/keyboard/keyboard.md b/hardware/keyboard/keyboard.md
index b1604e3..b62328e 100644
--- a/hardware/keyboard/keyboard.md
+++ b/hardware/keyboard/keyboard.md
@@ -37,10 +37,18 @@ Copy your keymap, e.g. if it's polish-1, then:
 
 Then change that map:
 
-> sudo -e /usr/share/kbd/keymaps/custom.map.gz
+> sudo vim /usr/share/kbd/keymaps/custom.map.gz
+
+---
+
+You can switch Escape and Caps Lock with a single line:
+
+> 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:
 
-> echo 'KEYMAP="/usr/share/kbd/keymaps/custom/*custom*.map.gz"'  | sudo tee /etc/vconsole.conf
+> echo 'KEYMAP="/usr/share/kbd/keymaps/*custom*.map.gz"'  | sudo tee /etc/vconsole.conf
 
 Reboot to have changes take effect.