0

There is a single "list" (in whichever storage form, even distributed across several files) of possible models that setxbmap understands. If the argument to setxbmap -model is not in that list, the command setxbmap would not understand it.

My guess (or expectation) is that the man page for xkeyboard-config should produce its output from the same "list" (i.e., the same sources) as used by setxbmap (at least when using a default configuration; I would understand if man did not know about user added configuration files). That doesn't seem to be the case. Command man -P cat xkeyboard-config does not list abnt, nor it is listed here, e.g. But setxkbmap -model abnt ... works. In this sense, man xkeyboard-config would be misleading.

How can the "mismatch" be explained?

An additional question appeared after tinkering. If I execute setxkbmap -model khassss ... (a randomly invented model), setxkbmap does not complain, and even setxkbmap -query prints ... model: khassss ....

What would setxkbmap actually take for the model in this case, to define its behaviour?

Notes:

  1. man -P cat xkeyboard-config doesn't even give abnt or abnt2 as a layout or variant, but I guess this is irrelevant for the question.

  2. I am not sure the version I have plays any role in the mismatch referred to (I expect it doesn't)

    $ apt-cache policy xkb-data
    xkb-data:
      Installed: 2.29-2
      Candidate: 2.29-2
      Version table:
     *** 2.29-2 500
            500 http://ar.archive.ubuntu.com/ubuntu focal/main amd64 Packages
            500 http://ar.archive.ubuntu.com/ubuntu focal/main i386 Packages
            100 /var/lib/dpkg/status
    

2 Answers2

1

The default Portuguese (Brazil) keyboard layout is designed with a Brazilian ABNT2 keyboard in mind. I'm thinking that, given the presence of that layout, it may not be considered necessary to specify abnt as a model.

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
  • Please see edited OP, which is much more precisely framed. I am intrigued by how the link you provided fits in the question. Probably because I cannot make sense of the expression "the presence of that layout".
    1. Are you referring to the layout pt? How would a user tie pt with abnt?
    2. Where is that "presence"? Is that in any list? Or in some file? If in a file, how would a user know of its (whatever object/layout "it" refers to) presence?
    – sancho.s ReinstateMonicaCellio May 21 '21 at 06:15
  • @sancho.sReinstateMonicaCellio: I'm referring to the br layout, not the pt one, and it's included if you run man xkeyboard-config. – Gunnar Hjalmarsson May 21 '21 at 12:32
  • Thanks for the clarification about the first part of question 1. Still, I am not clear about the rest, in the comment and the OP... – sancho.s ReinstateMonicaCellio May 21 '21 at 15:14
  • @sancho.sReinstateMonicaCellio: I'm not clear about the rest either. ;) AFAIK it makes no sense to state a keyboard model which does not exist, and abnt does not exist as an XKB keyboard model. Running setxkbmap br without mentioning the model is perfectly valid. – Gunnar Hjalmarsson May 21 '21 at 15:21
  • Ok, now I see your point, and you may be right. I took for granted that abnt is a valid model, given the fact that setxkbmap -model abnt ... works. But later I found (and I posted it in the OP!) that such command does not throw any error even if using a non-existing model. So that might simply be the answer. – sancho.s ReinstateMonicaCellio May 21 '21 at 15:24
0

The explanation to the mismatch

  1. man -P cat xkeyboard-config does not list abnt, but
  2. setxkbmap -model abnt ... works

is likely the following:

  1. Model abnt does not exist (that is why it is not listed with command 1), and
  2. setxkbmap -model <any_model> ... does not throw an error when using a non-existing any_model.

Observation 1 is supported by (this would not find related files in the user directory, but I have none)

$ find /usr/share/X11/xkb/ -type f -exec grep -nH --color abnt {} \;
/usr/share/X11/xkb/geometry/pc:831:xkb_geometry "abnt2" {
/usr/share/X11/xkb/geometry/pc:886:}; // End of "abnt2" geometry
/usr/share/X11/xkb/symbols/sun_vndr/br:84:  xkb_symbols "abnt2" {
/usr/share/X11/xkb/symbols/sun_vndr/br:85:  include "br(abnt2)"
/usr/share/X11/xkb/symbols/br:2:xkb_symbols "abnt2" {
/usr/share/X11/xkb/symbols/br:49:    include "br(abnt2)"
/usr/share/X11/xkb/symbols/br:66:    include "br(abnt2)"

and observation 2 is detailed in the OP.

Perhaps Gunnar Hjalmarsson referred to this, but that wasn't very clear to me.