keyboard_layout.lua: quote command argument

This commit is contained in:
Alice Gaudon 2021-04-08 12:43:56 +02:00
parent 0bda31d908
commit 034462f8f8

View File

@ -11,7 +11,7 @@ local layouts = config.widgets.keyboard_layout.layouts
local current_layout_index = 1 local current_layout_index = 1
function switchLayout() function switchLayout()
current_layout_index = (current_layout_index % #(layouts)) + 1 current_layout_index = (current_layout_index % #(layouts)) + 1
os.execute(config.widgets.keyboard_layout.layout_switch_command .. " " .. layouts[current_layout_index]) os.execute(config.widgets.keyboard_layout.layout_switch_command .. " \"" .. layouts[current_layout_index] .. "\"")
end end
return { return {
@ -23,4 +23,4 @@ return {
hotkey.make(config.switch_alt, switchLayout, hotkey.make(config.switch_alt, switchLayout,
{ description = "switch keyboard layout (alternative)" }) { description = "switch keyboard layout (alternative)" })
end end
} }