Select keyboard layouts and input methods in the Typing menu
This commit is contained in:
1 parent
73c0660fde
commit
58d7429f53
15 files changed
+407
-15
No files matched your search
@@ -7,7 +7,7 @@ local keyboard = require("default.hypr.keyboard")
|
||||
local non_latin_layouts =
|
||||
" af am ara bd bg by et ge gr il in iq ir kg kh kz la lk mk mm mn mv np rs ru sy th tj ua "
|
||||
|
||||
local vconsole = keyboard.installed()
|
||||
local vconsole = keyboard.selected()
|
||||
|
||||
local kb_layout = vconsole.XKBLAYOUT or "us"
|
||||
local kb_variant = vconsole.XKBVARIANT or ""
|
||||
|
||||
@@ -25,6 +25,13 @@ local function read_values(path)
|
||||
return values
|
||||
end
|
||||
|
||||
function keyboard.selected()
|
||||
local paths = require("default.hypr.paths")
|
||||
local values = read_values(paths.config_home .. "/omarchy/keyboard-layouts")
|
||||
if values.XKBLAYOUT then return values end
|
||||
return keyboard.installed()
|
||||
end
|
||||
|
||||
function keyboard.vconsole()
|
||||
return read_values("/etc/vconsole.conf")
|
||||
end
|
||||
@@ -42,7 +49,7 @@ end
|
||||
-- Japanese (JIS) keyboards put +, ^, and the Henkan/Muhenkan keys where US
|
||||
-- keyboards don't, so a few defaults only apply when that layout leads.
|
||||
function keyboard.jis()
|
||||
local layout = keyboard.installed().XKBLAYOUT or "us"
|
||||
local layout = keyboard.selected().XKBLAYOUT or "us"
|
||||
return layout:match("^[^,]*") == "jp"
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user