Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function get_current_keymap()
- local fd = io.popen("setxkbmap -query")
- if not fd then return end
- for line in fd:lines() do
- if line:match("layout:") then
- local keymap = line:match("%s+.*")
- fd:close()
- if not keymap then
- return "unknown layout"
- else
- return keymap:gsub("%s", "")
- end
- end
- end
- fd:close()
- return "unknown layout"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement