RogerBW's Blog

Entering accented characters in Linux 25 July 2026

There are at several distinct ways of getting accented characters and other non-ASCII symbols in Linux. Confusingly, many of them seem to be called called "compose sequences" and none is apparently well-known.

Note that I'm talking here about the British keyboard layout; US etc. works the same way but has different mappings. I'm also assuming you're in a Unicode locale.

The first method is the "UK-extended" keyboard layout, standard on modern Linux and largely documented for ChromeOS here but not exactly the same as shown there; I haven't seen a canonical list specifically for non-Android Linux. One uses AltGr to modify another key either to generate a character in itself, or to generate a "dead key" code, which doesn't produce a character itself but modifies what comes next. So for example

AltGr m produces µ.

AltGr ' appears to do nothing, but followed by e produces ê.

Shift AltGr ' followed by S produces Š.

(And if you get all the presses and releases for that last one right the first time, from memory, you type that more often than I do, and I own a Škoda.)

The other method is the libX11 compose system, lightly documented at compose(5). (This probably won't work if you're on Wayland, but nor will lots of other things.) This is readily configurable, but more importantly the configuration file is human-readable. Details of how to find it are in that man page, but mine is at /usr/share/X11/locale/en_US.UTF-8/Compose and includes lines like

<Multi_key> <minus> <minus> <period>    : "–"   U2013 # EN DASH
<Multi_key> <minus> <minus> <minus>     : "—"   U2014 # EM DASH

But what is <Multi_key>? That is the "compose key", and you will need to choose a key that you're not using for anything else to dedicate to it. Some people use a spare Control key, some the pointless Windows or Menu keys, but I have chosen caps lock since I almost never want to type a long series of capital letters and this prevents me from doing so by accident.

So in my .xsession, to be run when I start a new graphical session, I have

setxkbmap -option compose:caps

(the setxkbmap command is in the x11-xkb-utils package which may already be installed).

Then I can type [capslock] [minus] [minus] [minus] and produce .

Those two should work pretty much everywhere (well, not through Virtualbox into Windows). There are also more specific means:

  • The GTk graphical toolkit library offers hex code entry to programs using it (so if you want to enter my favourite Unicode character, CYRILLIC LETTER MULTIOCULAR O, you need to know it's code A66E). For that: hold ctrl-shift, tap u, type the hex code, release ctrl-shift. This will work in many modern graphical applications such as web browsers. In some cases (such as desktop Signal, which uses Electron), it's ctrl-shift, tap u, release ctrl-shift, hex code, return.

  • Emacs of course does its own thing. Ctrl-x 8 [return] (hex code) [return]. This will also allow character names, and even supports tab completion.

  • urxvt (my preferred terminal) supports ctrl-shift, hex code, release ctrl-shift.

And probably more that I haven't discovered!

Add A Comment

Your Name
Your Email
Your Comment

Note that I will only approve comments that relate to the blog post itself, not ones that relate only to previous comments. This is to ensure that the blog remains outside the scope of the UK's Online Safety Act (2023).

Your submission will be ignored if any field is left blank, but your email address will not be displayed. Comments will be processed through markdown.

Search
Archive
Tags 1920s 1930s 1940s 1950s 1960s 1970s 1980s 1990s 2000s 2010s 2300ad 3d printing action advent of code aeronautics aikakirja anecdote animation anime army astronomy audio audio tech aviation base commerce battletech bayern beer boardgaming book of the week bookmonth chain of command children chris chronicle church of no redeeming virtues cold war comedy computing contemporary cornish smuggler cosmic encounter coup covid-19 crime crystal cthulhu eternal cycling dead of winter disaster doctor who documentary drama driving drone ecchi economics en garde espionage essen 2015 essen 2016 essen 2017 essen 2018 essen 2019 essen 2022 essen 2023 essen 2024 essen 2025 existential risk falklands war fandom fanfic fantasy feminism filk film firefly first world war flash point flight simulation food garmin drive gazebo genesys geocaching geodata gin gkp gurps gurps 101 gus harpoon historical history horror horrorm science fiction hugo 2014 hugo 2015 hugo 2016 hugo 2017 hugo 2018 hugo 2019 hugo 2020 hugo 2021 hugo 2022 hugo 2023 hugo 2024 hugo 2025 hugo-nebula reread humour in brief avoid instrumented life javascript julian simpson julie enfield kickstarter kotlin learn to play leaving earth linux liquor lovecraftiana lua mecha men with beards mpd museum music mystery naval noir non-fiction one for the brow openscad opera parody paul temple perl perl weekly challenge photography podcast poetry politics postscript powers prediction privacy project woolsack pyracantha python quantum rail raku ranting raspberry pi reading reading boardgames social real life restaurant review reviews romance rpg a day rpgs ruby rust scala science fiction scythe second world war security shipwreck simutrans smartphone south atlantic war squaddies stationery steampunk stuarts suburbia superheroes suspense talon television the resistance the weekly challenge thirsty meeples thriller tin soldier torg toys trailers travel type 26 type 31 type 45 typst vietnam war war wargaming weather wives and sweethearts writing about writing x-wing young adult
Special All book reviews, All film reviews
Produced by aikakirja v0.1