Hi Mohsen,

Frome here, I don't see any particular error in your code or anything. But
maybe you can start by remove some useless parts which can interact with
others or whatever.

Firstly, in your xorg.conf file, remove the line :
 > Option     "XkbOptions"  "grp:shifts_toggle"
This line, allow you to switch layouts with the shift keys, but without any
interaction with Awesome (so your widget will not be updated), it's not
what you want, but it can interfere.

Then, as you define your layout in the xorg.conf file, you don't need to
use
 > setxkbmap us,fa
in your xinit.rc file. When X starts, it reads the xorg.conf file and so
this line is useless.

Finally, you say that you can't change to persian language, but I see 3
layouts in your kbdcfg.layouts. Can you change between us and fa, but not
to Persian, or you can't change at all. In both cases, try to execute
manually the commands in your terminal, maybe setxkbmap will report you an
error (missing the -layout option, unrecognized layout name, etc.).

Just to finnish ; it's now recommended to not use the xorg.conf file, but
the xorg.conf.d/ folder with one file for each device.

Hopping that it will help you.

Regards,
Alexis

Le Mon Dec 01 2014 at 03:21:46, Mohsen Pahlevanzadeh <
[email protected]> a écrit :

>  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