Cedilla under C (ç) in 'US international with dead keys' keyboard layout in Linux
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puddle Jumping Looping
--
Chapters
00:00 Cedilla Under C (ç) In 'Us International With Dead Keys' Keyboard Layout In Linux
01:12 Accepted Answer Score 41
01:42 Answer 2 Score 40
02:48 Answer 3 Score 8
03:01 Answer 4 Score 1
04:27 Answer 5 Score 0
04:51 Thank you
--
Full question
https://superuser.com/questions/1075992/...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #keyboardlayout
#avk47
ACCEPTED ANSWER
Score 41
The key combination for ç
in US international with dead keys layout was there all along, but unlike the other Latin diacritics it does not involve a dead key:
AltGr+,=ç
AltGr+Shift+,=Ç
ANSWER 2
Score 40
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"
2. Change the Compose file:
sudo sed -i /usr/share/X11/locale/en_US.UTF-8/Compose -e 's/ć/ç/g' -e 's/Ć/Ç/g'
3. 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.
ANSWER 3
Score 8
If you like me don't have a AltGr button in your keyboard, try the following:
Right Alt + ,
ANSWER 4
Score 1
I have created a simple bash script following @ThoriumBR answer. This way, whenever there's an update to your system and you'll lose that config, you can just run the script again.
The script is idempotent, so feel free to run as many time as you want, the result won't change.
#!/usr/bin/env bash
# Setting vars up
COMPOSE_FILE='/usr/share/X11/locale/en_US.UTF-8/Compose'
GTK2_FILE='/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache'
GTK3_FILE='/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache'
ENV_FILE='/etc/environment'
# Backing up files
sudo cp ${COMPOSE_FILE} ${COMPOSE_FILE}.bak
sudo cp ${GTK2_FILE} ${GTK2_FILE}.bak
sudo cp ${GTK3_FILE} ${GTK3_FILE}.bak
# Fixing cedilla in Compose
sudo sed --in-place -e 's/ć/ç/g' ${COMPOSE_FILE}
sudo sed --in-place -e 's/Ć/Ç/g' ${COMPOSE_FILE}
# Fixing cedilla in GTK files
GTK_FILE_SEARCH_FOR='^"cedilla".*:en'
GTK_FILE_SED_EXP='s/^\(\"cedilla\".*:wa\)/\1:en/g'
grep -q ${GTK_FILE_SEARCH_FOR} ${GTK2_FILE}
[ $? -eq 1 ] && sudo sed --in-place -e ${GTK_FILE_SED_EXP} ${GTK2_FILE}
grep -q ${GTK_FILE_SEARCH_FOR} ${GTK3_FILE}
[ $? -eq 1 ] && sudo sed --in-place -e ${GTK_FILE_SED_EXP} ${GTK3_FILE}
# Fixing cedilla in environment file
ENV_FILE_GTK_LINE='GTK_IM_MODULE=cedilla'
ENV_FILE_QT_LINE='QT_IM_MODULE=cedilla'
grep -q ${ENV_FILE_GTK_LINE} ${ENV_FILE}
[ $? -eq 1 ] && echo ${ENV_FILE_GTK_LINE} | sudo tee -a ${ENV_FILE} > /dev/null
grep -q ${ENV_FILE_QT_LINE} ${ENV_FILE}
[ $? -eq 1 ] && echo ${ENV_FILE_QT_LINE} | sudo tee -a ${ENV_FILE} > /dev/null
Then you can save it to a file such as fix-cedilla.sh
and run it with bash fix-cedilla.sh
. Or you can mark that file as executable with chmod +x fix-cedilla.sh
and run it with ./fix-cedilla.sh
.
You can/should also add it to your dotfiles repo (example of mine) so next time you (re)install your OS it's handy in a known place ;-)
ANSWER 5
Score 0
You can use a combination of uim
as input manager with a XCompose
file to reproduce the Microsoft Windows behavior for English international keyboards.
I've wrote some instructions for several distros (and even a Ubuntu package): https://github.com/raelgc/win_us_intl/