Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

[SOLVED] Switching keyboard layout per window

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
Apopatos
Guru
Guru
User avatar
Posts: 512
Joined: Sun Oct 17, 2004 10:54 am
Location: Hellas

[SOLVED] Switching keyboard layout per window

  • Quote

Post by Apopatos » Sun Nov 22, 2020 1:31 pm

Hello guys,
I use Openbox as my window manager.
By adding these lines to /etc/X11/xorg.conf.d/10-keyboard.conf

Code: Select all

Section "InputClass"
    Identifier "thinkpad60"
    Driver "evdev"
    Option "XkbLayout" "gb,gr"
    Option "XkbVariant" "extd,extended"
    Option "XkbOptions" "grp:alt_shift_toggle,grp_led:caps"
    MatchIsKeyboard "on"
EndSection
I am able to switch globally between british and greek layout.

However, I often need to write greek in one window or application and english to another one. As far as I remember, KDE and Gnome Shelll have such an option but with Openbox I haven't found a way yet.

In Arch Linux forums I have found this old solution
https://bbs.archlinux.org/viewtopic.php?id=69445

to create /etc/hal/fdi/10-keymap.fdi
and add these lines

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
 <device>
   <match key="info.capabilities" contains="input.keymap">
     <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
   </match>

   <match key="info.capabilities" contains="input.keys">
     <merge key="input.xkb.rules" type="string">base</merge>

     <!-- If we're using Linux, we use evdev by default (falling back to
          keyboard otherwise). -->
     <merge key="input.xkb.model" type="string">keyboard</merge>
     <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
            string="Linux">
       <merge key="input.xkb.model" type="string">evdev</merge>
     </match>

     <merge key="input.xkb.layout" type="string">us,il</merge>
     <merge key="input.xkb.model" type="string">pc105</merge>
  <merge key="input.xkb.Options" type="string">grp:ctrl_shift_toggle</merge>
   </match>
 </device>
</deviceinfo>
and then install xxkb and load it with system start up.
But this solution is over 10 years old and it needs hal.
Is there any way to implement in in a current system?

thanks in advance
Last edited by Apopatos on Mon Nov 23, 2020 10:31 pm, edited 1 time in total.
Top
cboldt
Veteran
Veteran
User avatar
Posts: 1046
Joined: Wed Aug 24, 2005 2:54 pm

  • Quote

Post by cboldt » Sun Nov 22, 2020 2:34 pm

Not sure but this might work. Launch the terminal with a name, then I believe you can do keyboard mapping with .Xdefaults It's certainly possible to map individual keys and key combinations. Those gory details are part of the terminal settings.

I use mostly urxvt at a terminal, and while these are not keyboard variants, you can see the use of different terminal names. Whlie many of these settings are common between the two example terminals, the settings are NOT the default when a terminal is opened.

Code: Select all

Uevolute*cursorColor: Gold2
Uevolute*pointerColor: Yellow3
Uevolute*inheritPixmap: False
Uevolute*backgroundPixmap: /home/cboldt/graphics/Uour-pond.xpm;100
Uevolute*saveLines: 100

Uhypoid*cursorColor: Gold2
Uhypoid*pointerColor: Yellow3
Uhypoid*inheritPixmap: False
Uhypoid*backgroundPixmap: /home/cboldt/graphics/Umarbles2.xpm;80
Uhypoid*saveLines: 100
The terminals are launched from fvwm script. Different terminals are launched with different names, using `urxvt -name Uevolute` for example.
Top
AlexJGreen
Tux's lil' helper
Tux's lil' helper
Posts: 149
Joined: Wed Sep 19, 2018 5:37 pm

  • Quote

Post by AlexJGreen » Mon Nov 23, 2020 12:48 am

_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:00 am, edited 1 time in total.
Top
Apopatos
Guru
Guru
User avatar
Posts: 512
Joined: Sun Oct 17, 2004 10:54 am
Location: Hellas

  • Quote

Post by Apopatos » Mon Nov 23, 2020 10:30 pm

kbdd solved the problem!
Thanks a lot for your help both of you!
Top
Apopatos
Guru
Guru
User avatar
Posts: 512
Joined: Sun Oct 17, 2004 10:54 am
Location: Hellas

  • Quote

Post by Apopatos » Fri Dec 04, 2020 5:38 pm

This small app works everywhere. In different apps, in different windows of the same app, everywhere except from Telegram, the main application I need it for :cry:
Top
Post Reply

5 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic