Fixing the Cedilla Keybinding on Linux Using the Compose Key

July 29, 2025 in and linux.

If you’re using a Compose key on Linux and typing ' + c gives you ć instead of ç, you’re not alone. This behavior can be frustrating for users who type in Portuguese, French, or other Latin-based languages.

Thankfully, there’s a clean and safe way to fix this — without touching system files — by using a local override with ~/.XCompose.

Rather than editing system-wide configuration, we can override specific Compose key mappings at the user level.

Step 1: Create or edit ~/.XCompose

Open (or create) the file ~/.XCompose and add the following:

include "/usr/share/X11/locale/en_US.UTF-8/Compose"

<dead_acute> <c> : "ç" U00E7
<dead_acute> <C> : "Ç" U00C7

This file tells X11 to:

  1. Include all default Compose rules from the system.
  2. Override just two mappings — so that ' + c gives you ç (U+00E7), and ' + C gives you Ç (U+00C7).

Step 2: Make sure it’s used

Most modern Linux environments will pick up ~/.XCompose automatically. If it doesn’t seem to take effect, explicitly tell the system to use it by adding this line to your ~/.xprofile, ~/.profile, or shell config (e.g., ~/.bashrc):

export XCOMPOSEFILE=$HOME/.XCompose

Then log out and log back in, or restart your desktop environment.

Test It

Use your Compose key (often set to Right Alt or a custom key) and try:

  • ' + c → ç
  • ' + C → Ç

If that works, you’re done!

If you absolutely need to modify the system-wide file (e.g., for kiosk setups or non-user environments), here’s how:

COMPOSE_FILE='/usr/share/X11/locale/en_US.UTF-8/Compose'

# Backup first!
sudo cp "${COMPOSE_FILE}" "${COMPOSE_FILE}.bak"

# Replace incorrect cedilla mappings
sudo sed --in-place -e 's/ć/ç/g' "${COMPOSE_FILE}"
sudo sed --in-place -e 's/Ć/Ç/g' "${COMPOSE_FILE}"

Then restart your session. This will affect all users.

Bonus: Restore System File If You Changed It

If you previously edited the system file and want to revert:

sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose.bak /usr/share/X11/locale/en_US.UTF-8/Compose

Why Use Compose Key Customization?

  • It’s simple and flexible.
  • Works across desktop environments (GNOME, KDE, etc.).
  • You can add your own accents, symbols, or emoji sequences.

Final Thoughts

Using a local ~/.XCompose is the cleanest and most portable solution to fix Compose key issues like incorrect cedilla mappings. It’s non-invasive, safe, and easy to version or share between machines.

Let me know if you’ve found other useful Compose overrides — or if you want to expand this setup with more custom characters!