You are not logged in.

#1 2022-09-06 18:13:12

fraxoz
Member
From: Italy
Registered: 2021-11-19
Posts: 13

Multiple keyboard-specific layout settings

I was hooking up my USB keyboard to my ThinkPad when I noticed that the USB keyboard had an Italian layout, while the laptop has a US one.
I was looking online if it would have been possible but the only useful thing I found talked about matching the USB id in a /etc/X11/Xorg.conf.d/00-keyboard.conf, but, living in Italy, I wanted to do the opposite, making an exception to the Italian layout for the ThinkPad's keyboard (which either isn't USB or lsusb doesn't show it to me), but I can't seem to find anything online about it.
Any ideas on how to do such a thing?
--EDIT--
Is it possible to use a "manager" of some sorts to choose on the go the layout instead?

Last edited by fraxoz (2022-09-06 19:20:56)

Offline

#2 2022-09-07 04:56:30

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,652
Website

Re: Multiple keyboard-specific layout settings

You can switch keyboard layout on the fly with a terminal command (eg to choose Japanese):

setxkbmap jp

You need to look up the country codes for the layouts you need.

There are some utilities to switch between layouts, eg you could have a look at gxkb.

Even better would be a way to permanently set different layouts for your two different keyboards. I've never tried to do this but with luck someone might be able to help you.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#3 2022-09-07 06:26:45

balloon
Member
From: 日本 Japan
Registered: 2015-11-21
Posts: 53
Website

Re: Multiple keyboard-specific layout settings

iBus is favored for multi-language keyboard switching. Currently used by GNOME 3, but can also be used with Openbox+tint2.

sudo apt install ibus

Please logout -> login or restart after installation. Then select the language to use in ibus-setup. There is a country code icon in tint2, so you can switch with it.

Or there are also some lighter weight keyboard switcher apps. if there is anything you like.
However, there may be little additional information about these.
https://wiki.archlinux.org/title/List_o … _switchers

Last edited by balloon (2022-09-07 06:44:54)

Offline

#4 2022-09-07 21:15:29

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Multiple keyboard-specific layout settings

Can't test, but I would try, 1st to get device ids

xinput -list | grep -i key

then (depending on the ids)

setxkbmap -device 12 -layout it
setxkbmap -device 14 -layout us

If that works, then I would find a proper file to stick this two calls into.

Looking at this thread:
https://superuser.com/questions/75817/t … ard-layout

Offline

#5 2022-09-08 13:59:25

fraxoz
Member
From: Italy
Registered: 2021-11-19
Posts: 13

Re: Multiple keyboard-specific layout settings

I'd say this is the winning solution since it's exactly what I was searching.
Thanks!

Offline

#6 2025-01-01 04:08:46

jimjamz
Member
From: Nagasaki, Japan
Registered: 2016-04-04
Posts: 189

Re: Multiple keyboard-specific layout settings

I followed the steps provided here for the setxkbmap approach, to switch between gb and jp.

However, I notice when trying to switch to jp, I have no Asian character support.

Installing gxkb as @johnraff recommended, displays the country flag for the current language selected.

This works for both us and gb, but when choosing jp, the flag shown is simply a question mark (?) indicating something is missing.

Do I have to install Japanese language support packages, and if so, what are they in apt?

Last edited by jimjamz (2025-01-01 04:10:50)

Offline

#7 2025-01-01 05:29:29

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,652
Website

Re: Multiple keyboard-specific layout settings

^To display Japanese all you need is to install a Japanese font. I like VL Gothic (package fonts-vlgothic) but there are plenty of others. To support a whole range of Asian languages there is the fonts-noto family (for Chinese, Japanese and Korean  you'd need fonts-noto-cjk )

To be able to input Japanese you need an input method editor, like ibus mentioned above, or fcitx which I use. For that, you can install fcitx-mozc and the necessary dependencies will be pulled in. In fact, there is a newer fcitx5 which I haven't yet switched to, but people starting out right now would probably be better installing fcitx5-mozc + dependencies.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#8 2025-01-28 17:16:57

eightysixed
Member
From: USA
Registered: 2024-11-24
Posts: 58

Re: Multiple keyboard-specific layout settings

I don't know if this is semi-related or not, but how in the world do I stop right-click from closing an app open on the tray, or stop right-click-to-delete in whatever file explorer tongue

Offline

#9 2025-01-29 04:06:27

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,652
Website

Re: Multiple keyboard-specific layout settings

eightysixed wrote:

I don't know if this is semi-related or not

It's not really - this thread is about country-specific keyboard layouts.
But anyway:

how in the world do I stop right-click from closing an app open on the tray, or stop right-click-to-delete in whatever file explorer

Two separate issues:

1) if you're using tint2 as the taskbar (BL default) then edit the tint2rc you're using. Find

mouse_right = <whatever>

and edit the <whatever>. That's for a right-click on the taskbar.

2) "whatever file explorer" is down to what that file explorer is. If it's a Thunar window then right-click should open the context menu, it certainly shouldn't delete the file. yikes

If you need to go into this further, could you start a new topic?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB