Dear all,

I migrate to awesome, But may be awesome depend on X, At first i provided xorg.conf with:
Xorg -configure

Then i changed InputClass such as :
///////////////////////////////////
   Section "InputClass"
       Identifier      "keyboard0"
       Driver          "evdev"
       #MatchIsKeyboard "on"
       Option     "XkbModel"    "evdev"
       # Switch between layouts by pressing both shift keys
       Option     "XkbLayout"   "us,fa"
       Option     "XkbOptions"  "grp:shifts_toggle"
   EndSection

////////////////////////////////
Then :
 cp /etc/xdg/awesome/rc.lua ~/.config/awesome/
Add the following change to it:
//////////////////////////////////////////////////
-- Keyboard map indicator and changer
    kbdcfg = {}
    kbdcfg.cmd = "setxkbmap"
    kbdcfg.layout = { "us", "fa", "Persian" }
    kbdcfg.current = 1  -- us is our default layout
    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] .. " "
       kbdcfg.widget.text = t
       os.execute( kbdcfg.cmd .. t )
    end
   -- Alt + Right Shift switches the current keyboard layout
    awful.key({ "Mod1" }, "Shift_R", function () kbdcfg.switch() end),   
    -- Mouse bindings
    kbdcfg.widget:buttons(awful.util.table.join(
        awful.button({ }, 1, function () kbdcfg.switch() end)
    ))
     -- end by me
////////////////////////////////////////////////////////
Also i add the folloiwoing section to layout:
/////////////////////////
right_layout:add(kbdcfg.widget)
//////////////////////////////////////////

Then i create a ~.xinitrc and pu into it:
//////////////////////////////////
#!/bin/sh
setxkbmap us,fa
///////////////////////////////
Also i put into the following code in rc.lua:
////////////////////////////////////////////
awful.key({ "Mod1" }, "Shift_R", function () kbdcfg.switch() end),
//////////////////////////////////////////////

But i can't change my keyboard language to persian language, how can i do it?
Where's my problem?
Please give me a link from key codes....

--Regards
Mohsen



-- To unsubscribe, send mail to [email protected].

Reply via email to