Files
omarchycn/default/hypr/input.lua
T
8147489f1d Allow toggling Caps Lock via both Shift keys
Adds shift:both_capslock alongside compose:caps so pressing both Shift
keys together toggles real Caps Lock. Caps Lock alone remains the
Compose key, and single-Shift behavior is unchanged. Provides an escape
hatch when Caps Lock gets stuck on (e.g. after an fcitx5 desync).

Closes #5981

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 20:05:39 -07:00

56 lines
1.2 KiB
Lua

-- https://wiki.hypr.land/Configuring/Basics/Variables/#input
local function read_vconsole()
local values = {}
local file = io.open("/etc/vconsole.conf", "r")
if not file then
return values
end
for line in file:lines() do
local key, value = line:match("^%s*([%w_]+)%s*=%s*(.-)%s*$")
if key and value then
value = value:gsub("%s+#.*$", "")
value = value:gsub('^"(.*)"$', "%1")
value = value:gsub("^'(.*)'$", "%1")
values[key] = value
end
end
file:close()
return values
end
local vconsole = read_vconsole()
hl.config({
input = {
kb_layout = vconsole.XKBLAYOUT or "us",
kb_variant = vconsole.XKBVARIANT or "",
kb_model = "",
kb_options = "compose:caps,shift:both_capslock",
kb_rules = "",
follow_mouse = 1,
sensitivity = 0,
repeat_rate = 40,
repeat_delay = 250,
numlock_by_default = true,
touchpad = {
natural_scroll = false,
clickfinger_behavior = true,
scroll_factor = 0.4,
},
},
misc = {
key_press_enables_dpms = true,
mouse_move_enables_dpms = true,
},
})
-- Scroll nicely in the terminal.
o.window("(Alacritty|kitty|foot)", { scroll_touchpad = 1.5 })
o.window("com.mitchellh.ghostty", { scroll_touchpad = 0.2 })