Thanks Uli, this works,
So the solution is to check:
if t == " de "

Patrick, in my system the command works like this:
setxkbmap <layout> <variant>

Going further I try to show "en" instead of "us" when english is the
language but my code doesn't work
I change
kbdcfg.widget.text = t
with
       kbdcfg.widget.text = function ()
          if t == " us " then return " en "
          else return t
          end
       end
When  i do that the widget doesn't work, it always show "us" and the
layout is not changing

manos~



On 08/06/2011 10:08 AM, Patrick Bethke wrote:
> The setxkbmap command to set a variant is
> setxkbmap <layout> -variant <variant>
> for example
> setxkbmap de -variant deadgraveacute
> not setxkbmap de deadgraveacute
>
>
> 2011/8/6 Uli Schlachter <psyc...@znc.in>:
>> On 06.08.2011 04:13, manos wrote:
>>> Hello,
>>>
>>> I am using the keyboard widget from the wiki and try to change it to
>>> pass also the variant (i want German qwerty, not qwertz that is the
>>> default).
>>>
>>> Code:
>>> kbdcfg = {}
>>>     kbdcfg.cmd = "setxkbmap"
>>>     kbdcfg.layout = { "us", "de", "el" }
>>>     kbdcfg.current = 1
>>>     kbdcfg.widget = widget({ type = "textbox", align = "right" })
>>>     kbdcfg.widget.text = " " .. kbdcfg.layout[kbdcfg.current] .. " "
>>>     kbdcfg.switch = function ()
>>>        kbdcfg.current = kbdcfg.current % #(kbdcfg.layout) + 1
>>>        local t = " " .. kbdcfg.layout[kbdcfg.current] .. " "
>> This sets t to e.g. " de "
>>
>>>        local v = "qwerty"
>>>        kbdcfg.widget.text = t      -- the change to the original code is
>>> after this line
>>>        if t == "de" then               -- have tried also "en", the
>>> previous layout
>> and " de " is not equal to "de".
>>
>>>           os.execute( kbdcfg.cmd .. t .. v )
>>>        else
>>>           os.execute( kbdcfg.cmd .. t )
>>>        end
>>>    end
>>>
>>> Any ideas?
>>>
>>
>> --
>> The Angels have the phone box!
>>
>> --
>> To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.
>>

-- 
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to