You are not logged in.

#1 2011-12-03 11:49:46

abutanaev
Member
From: Russia, Novosibirsk
Registered: 2011-03-29
Posts: 67

Keeping per window keyboard layout under X11

Sometimes you want to setup switching keyboard layouts using only X server - because there is no DE, or no DE keyboard plugin, or it's broken, or lacks needed functionality. You can easily configure X server to switch keyboard layouts, but I could not find way of keeping layout for each window separately using only X server. Hence this package: https://aur.archlinux.org/packages.php?ID=54504

Tested under xfce4.

Example of usage (~/.xinitrc file)

#!/bin/sh

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

export LANG=ru_RU.utf8

setxkbmap -layout 'us,ru(winkeys)' -model pc105 -option grp:rwin_toggle,grp_led:num

perWindowLayoutD

exec ck-launch-session dbus-launch startxfce4

Offline

#2 2011-12-03 12:39:01

Mad Fish
Member
Registered: 2009-09-22
Posts: 295

Re: Keeping per window keyboard layout under X11

Unfortunately, doesn't work properly with Openbox. Breaks on Alt+Tab.

Offline

#3 2011-12-04 05:38:41

abutanaev
Member
From: Russia, Novosibirsk
Registered: 2011-03-29
Posts: 67

Re: Keeping per window keyboard layout under X11

I've just installed openbox 3.5.0-4 and tried switching layouts. Alt+Tab works well for me - layout does change when changing windows. But there is another problem: if I close some window and focus goes to another window, layout isn't restored for this new focused window. Going to fix that.

As for Alt+Tab openbox, I cannot reproduce any problem. Could you please be more specific, what the problem you see?

Offline

#4 2011-12-04 09:40:22

abutanaev
Member
From: Russia, Novosibirsk
Registered: 2011-03-29
Posts: 67

Re: Keeping per window keyboard layout under X11

Fixed in 0.4 restoring layout after closing window under openbox. Also fixed restoring layouts after minimizing windows.

Offline

#5 2011-12-04 13:05:47

Mad Fish
Member
Registered: 2009-09-22
Posts: 295

Re: Keeping per window keyboard layout under X11

Well, with 0.4 everything seems to be working fine. Totally awesome, thanks.

Offline

#6 2011-12-04 13:38:16

Mad Fish
Member
Registered: 2009-09-22
Posts: 295

Re: Keeping per window keyboard layout under X11

By the way, can someone recommend an app to display a layout as a tray icon, that doesn't totally suck? smile

Offline

#7 2011-12-06 13:50:45

abutanaev
Member
From: Russia, Novosibirsk
Registered: 2011-03-29
Posts: 67

Re: Keeping per window keyboard layout under X11

I use num lock as layout indicator. It's not what you ask exactly but it is quite convenient, it doesn't require any additional software to run and doesn't occupy any place on the screen.

setxkbmap -layout 'us,ru(winkeys)' -model pc105 -option grp:rwin_toggle,grp_led:num

The stuff is: grp_led:num

Offline

#8 2011-12-06 15:34:04

Mad Fish
Member
Registered: 2009-09-22
Posts: 295

Re: Keeping per window keyboard layout under X11

Yes, I've noticed, but that will not suite my case, where I have 3 layouts. And usually I don't look at a keyboard when typing anyway. smile

Offline

#9 2011-12-06 16:19:46

RaisedFist
Member
From: Romania
Registered: 2007-01-30
Posts: 556
Website

Re: Keeping per window keyboard layout under X11

I'd like to see an icon too! big_smile

Offline

#10 2011-12-10 13:44:50

fsfg
Member
Registered: 2011-12-10
Posts: 1

Re: Keeping per window keyboard layout under X11

Offline

#11 2022-03-15 14:41:12

bijanbina
Member
From: Tehran
Registered: 2014-07-13
Posts: 20
Website

Re: Keeping per window keyboard layout under X11

Thanks Man,
Still After almost a decade still works like a charm.

Bests

------------
Just used

perWindowLayoutD

Last edited by bijanbina (2022-05-06 09:11:12)

Offline

Board footer

Powered by FluxBB