I've saved the output of

$ xmodmap -pke

in ~/.map1. Then, I have changed some settings through the Gnome Tweak Tool (say, to keep it simple, I swapped Esc and Caps Lock). Then I again saved the output of

$ xmodmap -pke

this time into ~/.map2.

~/.map1 and ~/.map2 are different. And they are different exactly in the way I was expecting. The differences correspond to the keys I have changed.

However I was not expecting the following: I have disabled all the changes made within the Gnome Tweak Tool, and I have loaded map2 with

$ xmodmap ~/.map2

I was expecting the same behavior achieved with the changes made with the Gnome Tweak Tool. But this is not the case. (That is now in the Gnome Terminal there is no difference of behavior whatsoever compared to the default settings. Within applications instead Esc key works correctly as Caps Lock, but it doesn't turn on the light of Caps Lock. And finally Caps Lock key seems to perform both the Esc and Caps Lock function).

So the following question arises: What are the files that the Gnome Tweak Tool is acting on?

It would be extremely useful for me to understand how things work here since I want to perform some changes that the Tweak Tool doesn't allow me to do and I'm not able to achieve them with xmodmap.



The files altered by gnome-tweak-tool are ~/.config/dconf/user (this is the dconf database, a binary file where most user settings are stored) and various other configuration files under ~/.config (these are all text files)

In this particular case - changing the typing settings - gnome-tweak-tool alters the xkb-options in the dconf database. It's easy to check that if you monitor the database with

dconf watch /

and then open gnome-tweak-tool and make CapsLock an additional Esc you'll get an output like

  • 1
    Thanks for the step towards the truth. Does this mean that if I want to do the same changes without using gnome-tweak-tool I should I directly modify the binary file ~/.config/dconf/user ? This doesn't seem good news :D – gptrst Apr 25 '17 at 14:34
  • 1
    @gptrst - no; I'm not sure what you're trying to accomplish over there (I suspect your Q is a XY question) but anyways you're not supposed to even touch that binary file. There are tools that have been designed to read/write to that file namely dconf and gsettings. As a side note: xmodmap is an obsolete tool and gnome3 mostly ignores it. If you want to implement more advanced settings then xkb is the right tool. – don_crissti Apr 25 '17 at 18:45
  • Yes it was an instrumental question in order to understand how to do those kinds of changes. Thanks for the note. – gptrst Apr 25 '17 at 21:29
  • @don_crissti: I'm came here looking to find which files contain Gnome's configuration (especially at the user level) so that I could copy that between my systems using SaltStack and maintain a consistent environment on all my machines. I suppose I'll just have to run gsettings commands, but passing in text files is a lot more convenient (which, of course, is why I was exploring the possibility). – nomen Feb 22 '20 at 17:29
  • @nomen - see if this helps... – don_crissti Feb 27 '20 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.