Sunday, June 03, 2012

Arch +lxde+openbox Keyboard Layout Portuguese/Brazil

I posted on a very similar topic just a few days ago where to switch between English (us) and Portuguese/Brazil (br) keyboards required no more than adding this line

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,br
to ~/.xinitrc.
After a reboot, Alt+Shift moved between us and br flawlessly.
However, that referred to Arch with lxde (DE), LXDM (DM) and Compiz (WM).

Now, I've taken out Compiz and use Openbox as the WM.
However, while adding the above line to /etc/xdg/lxsession/LXDE.autostart does indeed cause the keyboard layout to change on hitting Alt+Shift.

Only problem is, it's not the Portuguese/Brazil layout that I'm used to (abnt2). Indeed, it's pretty useless as there's no ç and no accents such as Â, õ or à.
In other words, it's essentially useless.

After much googling, I eventually stumbled upon a solution which involves altering the new line in /etc/xdg/lxsession/LXDE/autostart to
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,'br(abnt2)'
After a reboot, my PtBr layout is back.
Unfortunately, I have no explanation for this change.

Incidentally, lxde can put what's called a Keyboard Layout Switcher in the Desktop panel as explained in the first post here (yes, this is for PCLinuxOS but it works the same for Arch with lxde).
Now, for me it does not at all allow layout switching but does provide a nice colored icon for the countries whose languages you want to switch between.
So, it's a very useful indicator.
Switching can still be done using Alt+Shift.

No comments:

Post a Comment