lk/hardware/keyboard/keyboard.md

69 lines
1.3 KiB
Markdown
Raw Normal View History

2022-01-16 18:20:39 +00:00
---
title: "keyboard"
2022-10-22 01:16:18 +00:00
tags: [ "Documentation", "keyboard" ]
2022-01-16 18:20:39 +00:00
---
2022-10-22 01:16:18 +00:00
# Set Layout with X Display
2020-01-02 00:04:35 +00:00
Set layout to British English.
```bash
setxkbmap -layout gb
```
2020-01-02 00:04:35 +00:00
2021-05-15 14:41:45 +00:00
Or Polish with:
```bash
setxkbmap -layout pl
```
2021-05-15 14:41:45 +00:00
2020-01-02 00:04:35 +00:00
| 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
```
2020-01-02 00:04:35 +00:00
2022-06-05 09:14:48 +00:00
## Alt_GR
Remap, e.g., the right Windows key, to Alt_Gr.
```
key <RWIN> {[ ISO_Level3_Shift ]};
```
2022-11-06 13:28:09 +00:00
# Set TTY Keymap
2022-10-22 01:16:18 +00:00
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
```
2022-10-22 01:16:18 +00:00
Then change that map:
```bash
sudo vim /usr/share/kbd/keymaps/custom.map.gz
```
2022-12-10 07:02:21 +00:00
---
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"
```
2022-12-10 07:02:21 +00:00
---
2022-10-22 01:16:18 +00:00
Change the default keyboard mapping to the custom map:
```bash
echo 'KEYMAP="/usr/share/kbd/keymaps/*custom*.map.gz"' | sudo tee /etc/vconsole.conf
```
2022-10-22 01:16:18 +00:00
Reboot to have changes take effect.