Thursday, May 10, 2012

KBD layout switch and volume control in Arch/LXDE

Still very happy with Arch Linux as my prospective OS for my RPi (still one month to go before delivery).
However, as I've chosen the light DM LXDE, there's bound to be somethings missing.

Two missing items that I've particularly noticed up to now are a volume control applet and a convenient means of switching keyboard layout from one language to another.

The volume control was easily resolved by simply installing volwheel.
This is available in the community repo and is very easy to use and more versatile than the volume control applet in Gnome in that you can control the volume simply with the mouse wheel.

To get it to launch at boot, I simply copied the /usr/share/applications/volwheel.desktop file to ~/.config/autostart

Now I use both English and Brazilian Portuguese and like to quickly, and effortlessly switch between the two.
The AWN dock that I wrote about yesterday still has a fully functional Dialect applet which I've used for years.
However, as it seems unwise to rely on AWN surviving for very much longer, I need to find some other means of switching layouts.
Actually, there's quite a few suggestions, but many just don't work (for me, anyway).
Surprisingly this includes the suggestion in the Arch Wiki involving the ~/.xinitrc file.

Another that didn't work for me is shown in this post to an Arch forum thread. Surprisingly, its usefulness is confirmed by another contributor to the thread. Nevertheless, despite my best efforts, it just wouldn't do anything for me.

However, success comes to those who persist and eventually I came across this YouTube video.
This involves no more than adding this line

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,br
to the bottom of ~/.xinitrc and reboot. Now Alt-Shift changes from US to Br and vice-versa.

Incidentally, you can easily switch keyboard layouts from the command line by just typing
setxkbmap br  #or whatever language you want

No comments:

Post a Comment