summaryrefslogtreecommitdiff
path: root/input.lua
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-14 05:17:54 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-14 05:17:54 +0800
commitbc8a5889c4bb52405f2ac73d18a42ab43e93e867 (patch)
tree02eef02c4ce2de03d841e605440e0890f1ec8f9e /input.lua
parent25c5e0b1704b7d7cc4a37619a508c592f6a794c0 (diff)
feat: add Lua config modules for Hyprland
Split the monolithic Hyprland config into modular Lua files covering appearance, input, keybindings, monitors, startup, window rules, and workspace settings.
Diffstat (limited to 'input.lua')
-rw-r--r--input.lua51
1 files changed, 51 insertions, 0 deletions
diff --git a/input.lua b/input.lua
new file mode 100644
index 0000000..81e63b4
--- /dev/null
+++ b/input.lua
@@ -0,0 +1,51 @@
+-- 输入配置(对应 input.conf)
+-- 参考 https://wiki.hypr.land/Configuring/Basics/Variables/#input
+
+hl.config({
+ input = {
+ kb_layout = "us",
+ kb_variant = "",
+ kb_model = "",
+ kb_options = "caps:escape",
+ kb_rules = "",
+
+ follow_mouse = 1,
+
+ -- 合法范围 -1.0 ~ 1.0,0 表示不修改;旧 conf 中的 -10 已超出(原值被旧解析器忽略校验)
+ sensitivity = -1.0,
+ scroll_method = "2fg",
+
+ touchpad = {
+ natural_scroll = false,
+ scroll_factor = 0.5,
+ clickfinger_behavior = true,
+ drag_lock = 0,
+ tap_to_click = true,
+ drag_3fg = 2,
+ },
+ },
+})
+
+-- 触摸板手势(对应 input.conf 中的 gesture)
+-- 参考 https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/
+hl.gesture({
+ fingers = 3,
+ direction = "horizontal",
+ action = "workspace",
+})
+hl.gesture({
+ fingers = 3,
+ direction = "swipe",
+ mods = "ALT",
+ action = "move",
+})
+
+-- 每设备配置(对应 input.conf 中的 device 块)
+-- 参考 https://wiki.hypr.land/Configuring/Advanced-and-Cool/Devices/
+hl.device({
+ name = "elan07c8:00-04f3:3298-touchpad",
+ sensitivity = -0.2,
+ scroll_factor = 0,
+ accel_profile = "flat",
+ clickfinger_behavior = true,
+})