I installed Ubuntu 22.04.1 inside a mid 2012 MacBook Pro in an attempt to refurbish it and it's working great, I'm taking more advantage of the graphics part just to mention an example.
But I have a problem. I can't get the keyboard to work right while typing in Brazilian Portuguese in other windows other then the Firefox Brownser. xD
I tried many combinations inside the keyboard settings via graphic interface withouth sucess. One of the issues is that don't know how to save different "Alternate Charachters Key" and "Compose Keys".
When I close the dialogs for these options they return to "None" and "Layout default" even though I choose other options.
I managed to make the keyboard work partially (just inside Firefox, I don't know why) by choosing "Portuguse (Macintosh)" and running the following command:
setxkbmap -model abnt2 -layout us -variant intl
Does anybody knows how can I "extend" this command to affect other windows such as the Terminal or Text Editor for example?
I'm attaching a picture of the Keyboard as a reference for this question:

Here is the hardware specifications for this machine:
MacBook Pro (13-inch, Mid 2012)
Processor 2,9 GHz Dual-Core Intel Core i7
Memory 16 GB 1600 MHz DDR3
Graphics Intel HD Graphics 4000 1536 MB
Below is the result I got if I execute ls -al .config/dconf
:
total 16
drwx------ 2 chicortiz chicortiz 4096 dez 22 12:02 .
drwx------ 14 chicortiz chicortiz 4096 dez 21 22:04 ..
-rw-rw-r-- 1 chicortiz chicortiz 6344 dez 22 12:02 user
EDIT:
Part of the reply:
Screenshot: final setup inside the graphics interface:
