Skip to content

Instantly share code, notes, and snippets.

@ericdouglas
Last active July 16, 2024 23:15
Show Gist options
  • Save ericdouglas/74469cb97188751f71bfdcd7d28f75fd to your computer and use it in GitHub Desktop.
Save ericdouglas/74469cb97188751f71bfdcd7d28f75fd to your computer and use it in GitHub Desktop.
Cedilla under C (ç) in 'US international' keyboard layout in Linux

Add English (US, alt. intl.)

It's because the cedilla module isn't loaded by default when the locale is set to en, so you have to change the configuration files for gtk to add them:

  1. Edit configuration files:
sudo vim /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache

sudo vim /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache

On both, find the lines starting with "cedilla" "Cedilla" and add :en to the line. Something like this:

"cedilla" "Cedilla" "gtk30" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"
  1. Change the Compose file:
sudo sed -i /usr/share/X11/locale/en_US.UTF-8/Compose -e 's/ć/ç/g' -e 's/Ć/Ç/g'
  1. Instruct the system to load the cedilla module:

Add those lines to /etc/environment:

GTK_IM_MODULE=cedilla
QT_IM_MODULE=cedilla

Reboot and you are done.

source

@Firliminat
Copy link

Firliminat commented Jun 20, 2024

Alternative solution 3 (user space)

1. Create a `~/.XCompose` file with the following content:
 # UTF-8 (Unicode) compose sequences

 # Overrides C acute with Ccedilla:
 <dead_acute> <C> : "Ç" "Ccedilla"
 <dead_acute> <c> : "ç" "ccedilla"
2. Run the following command:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule': <'ibus'>}"
3. Restart the user session.

Thanks a lot ! That worked great for me and it's the best for me as it doesn't stop ibus from working with other layouts.
I need both the cedilla and Hangul characters.

I had done the first fix proposed before enabling Hangul through ibus and as we edited /etc/profile to add :

GTK_IM_MODULE=cedilla
QT_IM_MODULE=cedilla

ibus was not working properly for Hangul characters. It was only working in the Gnome search bar and the "Text editor" app.
It took me quite some times to understand that it was this modification causing the trouble. But when I came to this thread and undone the change of the first fix it worked. Then I used your "Alternative method 3" and it worked for my need ! Thanks again.

@rodrigoramos
Copy link

Works just fine for X11. But how about Wayland? Anyone have any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment