forked from ashpie/simple-awesome
Add kbdlayout system (Alt-Shift to switch layout)
This commit is contained in:
parent
929c94e865
commit
95e1567423
17
rc.lua
17
rc.lua
@ -110,6 +110,16 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
|
|||||||
-- Keyboard map indicator and switcher
|
-- Keyboard map indicator and switcher
|
||||||
mykeyboardlayout = awful.widget.keyboardlayout()
|
mykeyboardlayout = awful.widget.keyboardlayout()
|
||||||
|
|
||||||
|
kbdlayout = {}
|
||||||
|
kbdlayout.cmd = "setxkbmap"
|
||||||
|
kbdlayout.layouts = { "fr", "us" }
|
||||||
|
kbdlayout.cur = 1
|
||||||
|
kbdlayout.switch = function()
|
||||||
|
kbdlayout.cur = (kbdlayout.cur % #(kbdlayout.layouts)) + 1
|
||||||
|
local t = kbdlayout.layouts[kbdlayout.cur]
|
||||||
|
os.execute( kbdlayout.cmd .. " " .. t )
|
||||||
|
end
|
||||||
|
|
||||||
-- {{{ Wibar
|
-- {{{ Wibar
|
||||||
-- Create a textclock widget
|
-- Create a textclock widget
|
||||||
mytextclock = wibox.widget.textclock()
|
mytextclock = wibox.widget.textclock()
|
||||||
@ -388,7 +398,12 @@ globalkeys = gears.table.join(
|
|||||||
{description = "lua execute prompt", group = "awesome"}),
|
{description = "lua execute prompt", group = "awesome"}),
|
||||||
-- Menubar
|
-- Menubar
|
||||||
awful.key({ modkey }, "p", function() menubar.show() end,
|
awful.key({ modkey }, "p", function() menubar.show() end,
|
||||||
{description = "show the menubar", group = "launcher"})
|
{description = "show the menubar", group = "launcher"}),
|
||||||
|
-- Keyboard layout switch
|
||||||
|
awful.key({ "Mod1" }, "Shift_L", function () kbdlayout.switch() end,
|
||||||
|
{description = "switch keyboard layout"}),
|
||||||
|
awful.key({ "Shift" }, "Alt_L", function () kbdlayout.switch() end,
|
||||||
|
{description = "switch keyboard layout"})
|
||||||
)
|
)
|
||||||
|
|
||||||
clientkeys = gears.table.join(
|
clientkeys = gears.table.join(
|
||||||
|
Loading…
Reference in New Issue
Block a user