SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-04-16 06:04:23

ceph
Member
From: Auckland, NZ
Registered: 2011-04-14
Posts: 43
Website

Keyboard layout switcher and indicator for US(qwerty)/US(dvorak)

I wanted a tray-based input switcher/indicator that would switch between the standard US qwerty keyboard layout and US dvorak layout, given a visual cue of which variant I was using. The default indicator/switcher (fbxkb) that comes with #! would allow me to switch, however, the indicator icon would not change as they were both technically the 'us' layout.

I found that xxkb was able to do what I wanted (it allows custom images for up to four layout/variants combos), and I thought I would share my config for others that want a visual tray switcher for variant layouts using the same keyboard locale.

Here is what it looks like:
PunBB bbcode testPunBB bbcode test

And here is how I set it up (assuming 'stock' openbox tint2 panel):

1. Install xxkb

sudo aptitude install xxkb

2. Add the keyboard layout options, and the switcher, to your autostart.sh

setxkbmap -option "grp:switch,grp:shifts_toggle,grp_led:scroll" -layout "us,us(dvorak)" &
(sleep 6s && xxkb) &

the above setting will also allow you to use both shift buttons to switch

3. Edit/create .xxkbrc in your $HOME directory

XXkb.image.path: /home/<HOMEDIR>/.config/xxkb
XXkb.mainwindow.type: tray
XXkb.mainwindow.enable: yes
XXkb.mainwindow.geometry: 20x20+0+0
XXkb.mainwindow.image.1: us.xpm
XXkb.mainwindow.image.2: dv.xpm
XXkb.controls.mainwindow_delete: no
XXkb.button.enable: no

Obviously change image.path to where you keep your tokens

Also, if you set mainwindow_delete to 'yes', middle-clicking the tray icon will kill the switcher process. You may or may not want this, I found it annoying.

4. Input layout icons and sample config
You can download the custom images and basic config file from:
http://2ge4.net/files/crunchbang/xxkb.tar.gz

When I was setting this up I made a directory in $HOME/.config/xxkb, and I have the image files in that directory. I also store the above config in the same directory in a file called xxkbrc - I just make a symlink to that in my home directory by typing (whilst in my home directory):

ln -s .config/xxkb/xxkbrc .xxkbrc

If you have noticed this notice you may have noticed that this notice is not worth noticing

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo