Locale & Keyboard
Concepts: Locale vs. Keyboard vs. Fonts
These are three independent systems. Conflating them is common but wrong.
| System | What It Controls | When You Need to Change It |
|---|---|---|
Locale |
Date/time formats, number formatting, currency symbols, sort order, character classification |
Almost never. |
Keyboard Layout |
Which physical key produces which character. |
When you need to type in another script. Multiple layouts can coexist with a toggle key. |
Fonts |
Whether your terminal/browser can render the glyphs. A font must contain the Unicode codepoints for the script. |
When you see boxes (□□□) instead of characters. Install a font covering that script. |
The key insight: UTF-8 is a character encoding, not a language. Your en_US.UTF-8 locale can store, display, grep, and pipe Hebrew, Arabic, Japanese — any Unicode text — without changing anything. Locale only affects formatting (is the decimal separator . or ,?), not character support.
Locale
Current State
localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: (unset)
X11 Layout: (unset)
locale -a
locale
Locale Categories
Each category controls a different formatting aspect. All inherit from LANG unless overridden.
| Variable | Controls |
|---|---|
|
Master default — all categories inherit from this |
|
Sort order (affects |
|
Character classification (upper/lower, alpha/digit — critical for regex) |
|
System message language (error messages, man pages) |
|
Number formatting ( |
|
Date/time format |
|
Currency formatting |
|
Nuclear override — overrides ALL categories. Use sparingly. |
# Spanish date formatting, everything else English
export LC_TIME=es_ES.UTF-8
Generate a New Locale
# Before
sudo awk '/^#he_IL.UTF-8/' /etc/locale.gen
# Change
sudo sed -i 's/^#he_IL.UTF-8/he_IL.UTF-8/' /etc/locale.gen
sudo locale-gen
# After
locale -a | grep he_IL
he_IL.utf8
# Uncomment all at once
sudo sed -i 's/^#\(en_US.UTF-8\)/\1/; s/^#\(es_ES.UTF-8\)/\1/; s/^#\(he_IL.UTF-8\)/\1/' /etc/locale.gen
sudo locale-gen
You do NOT need to generate he_IL to read, grep, or display Hebrew. en_US.UTF-8 handles all Unicode. Generate it only if you want Hebrew-formatted dates/numbers.
|
Keyboard Layouts
How XKB Works
XKB (X Keyboard Extension) is the layout system used by both X11 and Wayland compositors. Key concepts:
| Term | Meaning |
|---|---|
Layout |
The base character mapping ( |
Variant |
A sub-layout within a layout ( |
Options |
Behavior modifiers — most important is the layout toggle key |
Model |
Physical keyboard model ( |
List Available Layouts
localectl list-x11-keymap-layouts
localectl list-x11-keymap-variants il
localectl list-x11-keymap-options | grep grp:
grp:alt_shift_toggle — Alt+Shift (current config) grp:win_space_toggle — Super+Space (macOS style) grp:ctrl_shift_toggle — Ctrl+Shift grp:caps_toggle — Caps Lock grp:ralt_toggle — Right Alt alone grp:lalt_toggle — Left Alt alone grp:toggle — Right Alt (legacy)
Hyprland (Your Setup)
Your Hyprland config at ~/.config/hypr/hyprland.conf line 118-120:
input {
kb_layout = us,es
kb_options = grp:alt_shift_toggle
}
This gives you US and Spanish, toggled with Alt+Shift.
input {
kb_layout = us,es,il
kb_options = grp:alt_shift_toggle
}
Alt+Shift now cycles: us → es → il → us.
hyprctl reload
hyprctl devices -j | jq '.keyboards[] | {name, active_keymap}'
# Next layout
hyprctl switchxkblayout all next
# Specific layout by index (0=us, 1=es, 2=il)
hyprctl switchxkblayout all 2
Layout Variants
input {
kb_layout = us,es,il
kb_variant = ,,biblical
kb_options = grp:alt_shift_toggle
}
The ,,biblical means: no variant for us, no variant for es, biblical variant for il.
Session-Only Testing (no config edit)
setxkbmap -layout us,es,il -option grp:alt_shift_toggle
setxkbmap -query
setxkbmap -layout us -option ""
Sway
input type:keyboard {
xkb_layout us,es,il
xkb_options grp:alt_shift_toggle
}
swaymsg reload
Console (TTY)
sudo localectl set-keymap us
Hebrew input in TTY requires kbd package and a Hebrew console keymap. For practical terminal scripture work, grep from existing text files — no Hebrew typing needed.
|
Fonts
Check Font Coverage for a Script
fc-list :lang=he
fc-list :lang=ar
fc-list :lang=ja
Install Fonts
sudo pacman -S noto-fonts noto-fonts-extra noto-fonts-cjk noto-fonts-emoji
| Package | Covers |
|---|---|
|
Latin, Greek, Cyrillic (base) |
|
Hebrew, Arabic, Thai, Devanagari, and 100+ other scripts |
|
Chinese, Japanese, Korean |
|
Emoji |
fc-list :lang=he | head -5
fc-cache -fv
Terminal Font Fallback
Your terminal emulator font (e.g., JetBrainsMono Nerd Font) likely doesn’t contain Hebrew glyphs. That’s fine — modern terminals fall back to system fonts.
| Terminal | Fallback Behavior |
|---|---|
Ghostty |
Automatic fallback via fontconfig |
Kitty |
Automatic, or set |
Alacritty |
Automatic fallback via fontconfig |
foot |
Automatic fallback |
echo "בְּרֵאשִׁית בָּרָא אֱלֹהִים"
If you see the Hebrew text with vowel points below the consonants, your font setup is correct.
Practical: Adding a New Language
# 1. Install fonts (if Hebrew renders as boxes)
sudo pacman -S noto-fonts-extra
# 2. Add keyboard layout to Hyprland
sed -i 's/kb_layout = us,es/kb_layout = us,es,il/' ~/.config/hypr/hyprland.conf
hyprctl reload
# 3. (Optional) Generate locale for Hebrew date formatting
sudo sed -i 's/^#he_IL.UTF-8/he_IL.UTF-8/' /etc/locale.gen
sudo locale-gen
# 4. Verify
fc-list :lang=he | head -1
hyprctl devices -j | jq '.keyboards[0].active_keymap'
echo "בְּרֵאשִׁית — Test"
# Fonts: already covered by noto-fonts-extra
# Layout: add 'ara' to kb_layout
sed -i 's/kb_layout = us,es,il/kb_layout = us,es,il,ara/' ~/.config/hypr/hyprland.conf
hyprctl reload
sudo pacman -S noto-fonts-cjk fcitx5 fcitx5-mozc fcitx5-gtk fcitx5-qt fcitx5-configtool
# Then configure fcitx5 — XKB alone only handles kana, not kanji conversion
| Latin-script languages (Spanish, French, German) and right-to-left scripts (Hebrew, Arabic) work fine with just XKB layout switching. CJK languages (Chinese, Japanese, Korean) need an input method framework (fcitx5 or ibus) because they require character composition. |
System Documentation
Linux documentation lives in five places. Knowing which to check first saves time.
| Source | What It Contains | How to Access |
|---|---|---|
man pages |
Command usage, config file format, system call reference. Organized by section (1=commands, 5=file formats, 7=concepts). |
|
info pages |
Extended documentation with chapters, cross-references. GNU projects use these (glibc, coreutils). Often more detailed than man pages. |
|
/usr/share/doc/ |
Package-specific docs, HTML references, READMEs, changelogs. Installed by packages. |
|
System config files |
The files themselves are documentation. Read them — they have comments explaining every option. |
|
Data files |
XKB layout definitions, fontconfig configs, keymap files. Readable source that defines behavior. |
|
Man Pages (verified on this system)
Locale & Character Sets
man locale # (1) Overview of locale categories and environment variables
man locale.conf # (5) systemd locale config file — /etc/locale.conf format
man localectl # (1) systemd tool to query and set locale + keyboard
man charsets # (7) Character set standards — ASCII, ISO-8859, UTF-8 history
man utf-8 # (7) UTF-8 encoding — how multi-byte characters work
man unicode # (7) Unicode standard — code points, planes, BMP
locale-gen has no man page on Arch. It’s a simple script: reads /etc/locale.gen, generates compiled locales in /usr/lib/locale/. Read it directly: cat $(which locale-gen).
|
Keyboard / XKB
man xkeyboard-config # (7) MASTER REFERENCE — every layout, variant, and option
man setxkbmap # (1) Set XKB layout from command line
man xkbcomp # (1) Compile XKB keymap — advanced, rarely needed directly
Fonts / Fontconfig
man fc-list # (1) List fonts — filter by :lang=, :family=, :style=
man fc-match # (1) Show which font the system selects for a pattern
man fc-cache # (1) Rebuild font cache after installing new fonts
man fc-cat # (1) Dump font cache contents
man fc-pattern # (1) Font pattern syntax — how filter expressions work
man fonts-conf # (5) Fontconfig configuration — /etc/fonts/fonts.conf format
Hyprland
man Hyprland # (1) General overview — note capital H
man hyprctl # (1) IPC control — keyword, dispatch, devices, clients
hyprctl keyword input:kb_layout us,es,il
hyprctl devices -j | jq '.keyboards[] | {name, active_keymap}'
Info Pages
The GNU C Library (glibc) info manual has a full chapter on locales — deeper than the man pages.
info libc 'Locales'
This covers: locale categories in detail, how setlocale() works, locale data format, and how programs use locale settings internally. Worth reading once to understand why locale exists, not just how to set it.
n — next node p — previous node u — up one level Enter — follow a cross-reference l — go back q — quit
System Config Files
These files ARE the documentation for your current state. Read them.
cat /etc/locale.gen # Which locales are enabled (uncommented lines)
cat /etc/locale.conf # System default locale (LANG=en_US.UTF-8)
cat /etc/vconsole.conf # Console keymap (TTY, not Wayland)
grep -A5 'kb_layout' ~/.config/hypr/hyprland.conf
Data Files (The Real Source of Truth)
XKB Layout Data
Everything XKB knows about keyboard layouts lives in /usr/share/X11/xkb/. These are plain text files — readable and greppable.
/usr/share/X11/xkb/ ├── symbols/ # Layout definitions — one file per language ├── rules/ # Mapping rules and the greppable index ├── keycodes/ # Physical key → keycode mapping ├── types/ # Key type definitions (shift behavior) ├── compat/ # Compatibility mappings └── geometry/ # Physical keyboard geometry (rarely needed)
cat /usr/share/X11/xkb/symbols/il
This shows exactly which physical key produces which Hebrew character — the source of truth for the il layout.
cat /usr/share/X11/xkb/symbols/es
grep 'grp:' /usr/share/X11/xkb/rules/evdev.lst
grp:alt_shift_toggle Alt+Shift grp:win_space_toggle Win+Space grp:ctrl_shift_toggle Ctrl+Shift grp:caps_toggle Caps Lock grp:ralt_toggle Right Alt
grep '^\s' /usr/share/X11/xkb/rules/evdev.lst | head -30
grep -A1 '^\s*il' /usr/share/X11/xkb/rules/evdev.lst | grep 'il:'
localectl list-x11-keymap-layouts # All layouts
localectl list-x11-keymap-variants il # Hebrew variants
localectl list-x11-keymap-options | grep grp: # Toggle options
Fontconfig Data
cat /etc/fonts/fonts.conf # Global config (usually points to conf.d/)
ls /etc/fonts/conf.d/ # Active config fragments (symlinks)
ls /usr/share/fontconfig/conf.avail/ # Available config fragments
# Fontconfig developer and user guides
ls /usr/share/doc/fontconfig/
# fontconfig-user.html — end-user configuration guide
# fontconfig-devel.html — developer API reference
Open in browser: firefox /usr/share/doc/fontconfig/fontconfig-user.html
Console Keymaps (TTY)
ls /usr/share/kbd/keymaps/i386/qwerty/il*
/usr/share/kbd/keymaps/i386/qwerty/il-heb.map.gz /usr/share/kbd/keymaps/i386/qwerty/il-phonetic.map.gz /usr/share/kbd/keymaps/i386/qwerty/il.map.gz
sudo loadkeys il
Web References
| Topic | URL |
|---|---|
Locale (Arch Wiki) |
|
Keyboard — Console |
wiki.archlinux.org/title/Linux_console/Keyboard_configuration |
Keyboard — Xorg/XKB |
|
Hyprland Input Config |
|
Fonts (Arch Wiki) |
|
Font Configuration |
|
Fcitx5 (CJK input) |
|
Unicode Code Charts |
|
Unicode CLDR |
Install arch-wiki-docs for offline access: sudo pacman -S arch-wiki-docs. Then browse at /usr/share/doc/arch-wiki/html/.
|