Krolyxon
Branch master

Branches

Refs →

aurora.configquickshellauroraSetInput.qml

101 lines · 5.8 KB · QML

1import QtQuick
2import QtQuick.Layouts
3
4// Settings app > Input: keyboard, mouse, touchpad, cursor, through HyprConf (live + persisted).
5Flickable {
6 id: flick
7 clip: true
8 contentWidth: width
9 contentHeight: col.implicitHeight
10 boundsBehavior: Flickable.StopAtBounds
11
12 Component.onCompleted: HyprConf.refresh()
13 function v(o, d) { var x = HyprConf.values[o]; return x === undefined ? d : x }
14
15 ColumnLayout {
16 id: col
17 width: flick.width
18 spacing: 22
19
20 Text {
21 Layout.fillWidth: true
22 Layout.leftMargin: 18
23 visible: HyprConf.message !== ""
24 text: HyprConf.message
25 color: Theme.err
26 wrapMode: Text.WordWrap
27 font.family: Theme.ui
28 font.pixelSize: 14
29 }
30
31 Group {
32 title: "keyboard"
33 keywords: "xkb typing"
34 Field { label: "layouts"; keywords: "keyboard layout language kb_layout"; placeholder: "us,de"; value: flick.v("input:kb_layout", ""); onSubmitted: x => HyprConf.set("input:kb_layout", x) }
35 Field { label: "variants"; keywords: "keyboard variant dvorak colemak"; placeholder: "(none)"; value: flick.v("input:kb_variant", ""); onSubmitted: x => HyprConf.set("input:kb_variant", x) }
36 Field { label: "xkb options"; keywords: "caps lock compose kb_options"; placeholder: "grp:alt_shift_toggle"; value: flick.v("input:kb_options", ""); onSubmitted: x => HyprConf.set("input:kb_options", x) }
37 Knob { label: "repeat rate"; keywords: "key repeat speed"; unit: "/s"; from: 10; to: 100; value: flick.v("input:repeat_rate", 25); onMoved: x => HyprConf.set("input:repeat_rate", x) }
38 Knob { label: "repeat delay"; keywords: "key repeat"; unit: "ms"; from: 150; to: 1000; value: flick.v("input:repeat_delay", 600); onMoved: x => HyprConf.set("input:repeat_delay", Math.round(x / 10) * 10) }
39 }
40
41 Group {
42 title: "mouse"
43 keywords: "pointer"
44 Knob { label: "sensitivity"; keywords: "mouse speed pointer"; from: -1; to: 1; decimals: 2; value: flick.v("input:sensitivity", 0); onMoved: x => HyprConf.set("input:sensitivity", x) }
45 Choice {
46 label: "acceleration"
47 keywords: "mouse accel"
48 options: [{ value: "", label: "default" }, { value: "flat", label: "flat" }, { value: "adaptive", label: "adaptive" }]
49 value: flick.v("input:accel_profile", "")
50 onPicked: x => HyprConf.set("input:accel_profile", x)
51 }
52 Choice {
53 label: "focus follows mouse"
54 keywords: "focus hover"
55 options: [{ value: 0, label: "off" }, { value: 1, label: "always" }, { value: 2, label: "loose" }, { value: 3, label: "hover only" }]
56 value: flick.v("input:follow_mouse", -1)
57 onPicked: x => HyprConf.set("input:follow_mouse", x)
58 }
59 Switch { label: "natural scroll"; keywords: "reverse scrolling"; checked: flick.v("input:natural_scroll", false); onToggled: on => HyprConf.set("input:natural_scroll", on) }
60 Switch { label: "left handed"; keywords: "swap buttons"; checked: flick.v("input:left_handed", false); onToggled: on => HyprConf.set("input:left_handed", on) }
61 }
62
63 Group {
64 title: "touchpad"
65 keywords: "trackpad"
66 Switch { label: "natural scroll"; keywords: "reverse scrolling"; checked: flick.v("input:touchpad:natural_scroll", false); onToggled: on => HyprConf.set("input:touchpad:natural_scroll", on) }
67 Switch { label: "tap to click"; keywords: "tap"; checked: flick.v("input:touchpad:tap_to_click", false); onToggled: on => HyprConf.set("input:touchpad:tap_to_click", on) }
68 Switch { label: "disable while typing"; keywords: "palm rejection dwt"; checked: flick.v("input:touchpad:disable_while_typing", false); onToggled: on => HyprConf.set("input:touchpad:disable_while_typing", on) }
69 Knob { label: "scroll speed"; keywords: "scroll factor"; from: 0.1; to: 3; decimals: 2; value: flick.v("input:touchpad:scroll_factor", 1); onMoved: x => HyprConf.set("input:touchpad:scroll_factor", x) }
70 }
71
72 Group {
73 title: "gestures"
74 keywords: "swipe touchpad fingers"
75 Switch { label: "invert swipe"; hint: "reverse the 3-finger workspace swipe"; checked: flick.v("gestures:workspace_swipe_invert", true); onToggled: on => HyprConf.set("gestures:workspace_swipe_invert", on) }
76 Knob { label: "swipe distance"; unit: "px"; from: 100; to: 1000; value: flick.v("gestures:workspace_swipe_distance", 300); onMoved: x => HyprConf.set("gestures:workspace_swipe_distance", Math.round(x / 10) * 10) }
77 }
78
79 Group {
80 title: "cursor"
81 keywords: "mouse pointer"
82 Knob { label: "hide when idle"; keywords: "cursor inactive timeout"; unit: "s"; from: 0; to: 30; value: flick.v("cursor:inactive_timeout", 0); onMoved: x => HyprConf.set("cursor:inactive_timeout", x) }
83 Switch { label: "hide while typing"; keywords: "cursor"; checked: flick.v("cursor:hide_on_key_press", false); onToggled: on => HyprConf.set("cursor:hide_on_key_press", on) }
84 }
85
86 RowLayout {
87 Layout.fillWidth: true
88 Text {
89 Layout.fillWidth: true
90 Layout.leftMargin: 18
91 text: "per-device settings (hl.device) stay in source/input.lua"
92 elide: Text.ElideRight
93 color: Theme.fgDim
94 font.family: Theme.ui
95 font.pixelSize: 13
96 }
97 IconBtn { icon: Theme.iRefresh; label: "reset to config"; keywords: "reset defaults restore hyprland"; onClicked: HyprConf.resetAll(["input:", "cursor:", "gestures:"]) }
98 }
99 Item { Layout.preferredHeight: 12 }
100 }
101}