From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EFAC25A2B5 for ; Fri, 27 Mar 2026 15:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774624328; cv=none; b=DTGTM3x7QphBQZi8hhqgaXtMDxKPg2xeHmYjSKSIadfhtoIeH3wDftm6/lve1jdNc0TqorLH8GgKsCgIdPndGeCB4GpjfsAviFbKQn494s2KEB6OHma3UiSkyBfS11FRZx/+hrJtwYxokNaWOUOSQQ4dLMxZ6ADgXfRZWYrHuSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774624328; c=relaxed/simple; bh=VUipbiAXvlfiaxazZMdlivcig+0PUQYgQXgwkL+qY7g=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=eLwVOWVJt2sxrEyNeuRExOGCTOk5VbtFX+gCrdlzDDaVCnfFZQVr8Uo4tzjcuT+W3im5h5d3a7adGGkAMbrk63/NQROg0+EtimVG+5d6c83+e+B3sORgtXK+QBdif1+idXbW3l2Phq4/46zkoO1kdhAaSt+IpRiAFWo1XCDwbZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MkVbgcRp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MkVbgcRp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B317C19423 for ; Fri, 27 Mar 2026 15:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774624328; bh=VUipbiAXvlfiaxazZMdlivcig+0PUQYgQXgwkL+qY7g=; h=Date:From:To:Subject:From; b=MkVbgcRpKy/dmTgdRIuYw5B/RGBXGPsUj9wPtNuxNUci8j/lfXXURMVRRlh7jY2YR IM3WygVBn6LdEhsCVBoIe3XHMXDe7uomxXZmSe4rSmq3zxOg7EqG2ljlr8smb+Tddy HOr6hrgFhLWO+Sn7VbEUnw8Vr6Fxp1szfzISgXzGw5UIb8/SQ9kMqQH1M8Q5JDaIBK UAAIrqmG0VPvNtUbYGMTQrr4Pc7Yt/rF0bOy6/C0kQ5LhCE20RjamE/fJ7za4HJCWU SlgyjxlX3fiWBaKV9SX0hjMjpKcHuxCmrmq7lprJ+10yuAVm763ZeRNHyAIT8iaen0 5ws9vO+aiET4A== Date: Fri, 27 Mar 2026 16:12:04 +0100 From: Alexey Gladkov To: linux console tools development discussion Subject: [RFC] xkb support in kbd Message-ID: Precedence: bulk X-Mailing-List: kbd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I have been working on xkb-based keymap import for kbd and would like to ask for testing and feedback. The work is here: https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git/?h=xkb The idea is to let `loadkeys` build a linux console keymap directly from xkb settings such as model, layout, variant and options. This is meant to make it easier to reuse the existing xkb layout data on the linux console instead of relying only on pre-generated console keymaps. In practice, this should make it possible to describe console layouts in the same terms people already use elsewhere in the stack. Since kernel keymaps and xkb differ significantly, the conversion has to be done on the fly and not everything can be converted. The groups (the layouts) are placed in the following way: 1 group : gr1->gr1->gr1->... 2 groups: gr1->gr2->gr1->gr2->... 3 groups: gr1->gr2->gr1->gr4->gr1->gr2->gr1->gr4->... 4 groups: gr1->gr2->gr3->gr4->gr1->gr2->gr3->gr4->... This follows the order in which layouts are switched in the console-setup from debian. Special thanks to Anton Zinoviev for the explanations To build it from a git checkout, configure kbd with xkb support enabled: ./configure --enable-xkb This requires libxkbcommon to be installed. Once built, `loadkeys` accepts xkb parameters directly. For example: ./loadkeys \ --xkb-model=pc105 \ --xkb-layout=us,ru \ --xkb-options=grp:caps_toggle To inspect the generated keymap without loading it into the kernel: ./loadkeys --tkeymap \ --xkb-model=pc105 \ --xkb-layout=us,ru \ --xkb-options=grp:caps_toggle Testing would be especially useful for: - non-trivial layouts and variants - multi-layout setups - AltGr and higher levels - group switching options - compose-heavy layouts If you try it, reports with the exact `loadkeys` command line, the expected behavior, and the actual behavior would be very helpful. In addition, I wrote a proof-of-concept of utility that displays the currently active layout in the top-right corner of the console. contrib/vcslayout.c I would also appreciate hearing your comments or suggestions regarding this approach. -- Rgrds, legion