You are not logged in.

#26 2009-09-14 13:39:32

From: Croatia
Registered: 2008-03-22
Posts: 834

Re: Detecting current Xorg keyboard layout

jbromley wrote:
anrxc wrote:
veox wrote:

thanks for the code, weird there was no such utility already.

So certainly similar software existed, but still there was none that did exactly what I wanted.

Of course it existed, not only it existed as some obscure utility, but was also in the repos. That is all. I don't think your utility is a waste of time.

You need to install an RTFM interface.


#27 2009-10-21 18:30:22

Registered: 2008-10-28
Posts: 48

Re: Detecting current Xorg keyboard layout

Does this work with Ruby 1.9? On a quick check, there's some trouble with SWIG or something. Sorry, I don't have the time to investigate right now.


#28 2010-01-31 21:37:30

Registered: 2010-01-31
Posts: 9

Re: Detecting current Xorg keyboard layout

yhager wrote:

jbromley, thanks for the code, it works perfectly.

I uses two layouts under Window Maker: hungarian and usa. (Yes my favorite window manager is very old, but quick, and small).
I set my wm, when I push the ScrollLock button it is changes the actual layout another and vica versa (flip-flop).
I wrote an example file with doityourself adesklet which is check and show the actual Xorg keyboard layout, and can change it (predefinied values) if I click on.

Here is my script:

# This is a back-end script for doityourself. It displays the output
# of the setxkbmap layout, and changes from us to hungarian layout
# or from hungarian to us layout

case $1 in
        init)   echo "<font 'VeraMono/15'/>"
                echo "<background.color None/>" ;;
        test)   keymap=$(setxkbmap -v | awk -F "+" '/symbols/ {print $2}')
                echo ${keymap:0:2} ;;
        click)  if (setxkbmap -v | grep -q hu)
                    then exec setxkbmap us
                    else exec setxkbmap -layout "hu(qwerty)"
                fi ;;
        *)      echo "Usage: $0 [ init | test | click ] test-value"

This code should just copy your ~/.desklets/doityourself-0.4.1/scripts/ directory, and should to change a ~/.desklets/doityourself-0.4.1/scripts/ config.txt last lines:

id0 = {'rawmode': False, 'script': ''}

That's it!

Last edited by Goosfrabaa (2010-01-31 21:38:29)


Board footer

Powered by FluxBB