You are not logged in.

#1 2013-03-10 05:58:10

hariskar
Member
From: Greece/Kavala
Registered: 2012-10-16
Posts: 185

Awesome and i3 keyboard layout switch problem

I followed this guide http://awesome.naquadah.org/wiki/Change_keyboard_maps and pasted

-- Keyboard map indicator and changer
kbdcfg = {}
kbdcfg.cmd = "setxkbmap"
kbdcfg.layout = { { "us", "" }, { "gr", "" } }
kbdcfg.current = 1  -- us is our default layout
kbdcfg.widget = wibox.widget.textbox()
kbdcfg.widget:set_text(" " .. kbdcfg.layout[kbdcfg.current][1] .. " ")
kbdcfg.switch = function ()
  kbdcfg.current = kbdcfg.current % #(kbdcfg.layout) + 1
  local t = kbdcfg.layout[kbdcfg.current]
  kbdcfg.widget:set_text(" " .. t[1] .. " ")
  os.execute( kbdcfg.cmd .. " " .. t[1] .. " " .. t[2] )
end

 -- Mouse bindings
kbdcfg.widget:buttons(
 awful.util.table.join(awful.button({ }, 1, function () kbdcfg.switch() end))
) 

and

-- Alt + Right Shift switches the current keyboard layout
    awful.key({ "Mod1" }, "Shift_R", function () kbdcfg.switch() end),

It works with the mouse. The problem I have is that with keyboard shortcut (Alt + Shift_R) if I click it once it works (it changes to gr). After that I cannot use Alt + Shift_R again to go back to us while mouse works.
If I click the combination 2 (or 4) times it works (gr-us-gr-us) and then it works again to go to gr.
But if I click the combination 1, 3 or 5 times (gr-us-gr) then it does not work anymore, I have to use the mouse to change from gr.
Also, the Num Lock light switches off when I use Alt+Shift_R (but I can use the numbers).
Any idea why these happen?
Thank you

Last edited by hariskar (2013-03-15 14:30:56)

Offline

#2 2013-03-10 16:45:16

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 835
Website

Re: Awesome and i3 keyboard layout switch problem

Any idea why these happen?

Ignore the widget for a moment and execute the same commands in a terminal emulator:
setxkbmap us
setxkbmap gr
setxkbmap us

No problems with the keyboard in that case?


You need to install an RTFM interface.

Offline

#3 2013-03-11 17:43:13

hariskar
Member
From: Greece/Kavala
Registered: 2012-10-16
Posts: 185

Re: Awesome and i3 keyboard layout switch problem

The keyboard layout changes (the tray indication does not)

Offline

#4 2013-03-12 19:40:29

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 835
Website

Re: Awesome and i3 keyboard layout switch problem

The keyboard layout changes

Of course it does, but does your keyboard break apart on Altrg and all that other stuff? Then we have to ask what is different between
environment of your bash terminal and that of the Lua prompt. Or find another app that can do it without breaking the layout.

Last edited by anrxc (2013-03-12 19:41:06)


You need to install an RTFM interface.

Offline

#5 2013-03-15 14:30:41

hariskar
Member
From: Greece/Kavala
Registered: 2012-10-16
Posts: 185

Re: Awesome and i3 keyboard layout switch problem

With setxkbmap gr no right Alt shortcut works, even right Alt+Enter
I use i3 these day to see if the problem with keyboard layout exists here too: It exists.
I tried putting in xinitrc:

setxkbmap -option grp:switch,grp:alt_shift_toggle us,el

it works only with left alt_shift, both directions us>gr, gr>us, but breaks right Alt shortcuts

setxkbmap -option grp:switch,grp:lalt_shift_toggle,grp_led:scroll us,gr

does not work and breaks right Alt shortcuts

setxkbmap -option grp:switch,grp:Super_L_shift_toggle,grp_led:scroll us,gr

does not work and breaks right Alt shortcuts

Any solution?

Last edited by hariskar (2013-03-15 14:32:17)

Offline

Board footer

Powered by FluxBB