Load the whole config again under Hyprland 0.57
Hyprland 0.57 refuses a bind on a bare modifier and an empty input:scroll_method. The switcher's Super-release commit now binds Super_L and Super_R, which also brings back every bind below it in keybinds.lua. An empty scroll method is left unwritten, so libinput still picks per device.
This commit is contained in:
1 parent
48e5ea9a39
commit
0add5af1b9
3 files changed
+26
-19
No files matched your search
@@ -8,6 +8,14 @@
|
|||||||
local prefs = require("prefs")
|
local prefs = require("prefs")
|
||||||
local actions = require("actions")
|
local actions = require("actions")
|
||||||
|
|
||||||
|
-- Empty means "let libinput pick per device". Hyprland 0.57 rejects "" for
|
||||||
|
-- this option, so empty is expressed by not writing it at all: nil drops the
|
||||||
|
-- key from the table below and the option stays at its unset default.
|
||||||
|
local scroll_method = prefs.get("scrollMethod", "")
|
||||||
|
if scroll_method == "" then
|
||||||
|
scroll_method = nil
|
||||||
|
end
|
||||||
|
|
||||||
hl.config({
|
hl.config({
|
||||||
input = {
|
input = {
|
||||||
kb_layout = prefs.get("keyboardLayout", "us"),
|
kb_layout = prefs.get("keyboardLayout", "us"),
|
||||||
@@ -52,16 +60,12 @@ hl.config({
|
|||||||
scroll_factor = prefs.get("scrollFactor", 1.0),
|
scroll_factor = prefs.get("scrollFactor", 1.0),
|
||||||
left_handed = prefs.get("leftHanded", false),
|
left_handed = prefs.get("leftHanded", false),
|
||||||
|
|
||||||
-- Empty is a value, not an omission: it is what `hyprctl getoption`
|
-- Empty (omitted, see above) is what `hyprctl getoption` reports as
|
||||||
-- reports as "[[EMPTY]]" before anything writes the option, and it means
|
-- "[[EMPTY]]": libinput picks per device -- two fingers on a touchpad,
|
||||||
-- "let libinput pick per device" -- two fingers on a touchpad, the wheel
|
-- the wheel on a mouse. Settings offers 2fg / edge / on_button_down /
|
||||||
-- on a mouse. Writing it back explicitly is the same branch a stock
|
|
||||||
-- Hyprland takes, and it keeps the setting reversible: without an empty
|
|
||||||
-- choice in the schema there would be no way back from a scroll method
|
|
||||||
-- once one was picked. Settings offers 2fg / edge / on_button_down /
|
|
||||||
-- no_scroll alongside it, the four words the option's own description
|
-- no_scroll alongside it, the four words the option's own description
|
||||||
-- names (it publishes no map).
|
-- names (it publishes no map).
|
||||||
scroll_method = prefs.get("scrollMethod", ""),
|
scroll_method = scroll_method,
|
||||||
|
|
||||||
-- Only consulted while scroll_method is on_button_down. 0 means the
|
-- Only consulted while scroll_method is on_button_down. 0 means the
|
||||||
-- device's own middle button.
|
-- device's own middle button.
|
||||||
|
|||||||
@@ -377,15 +377,18 @@ bind(mod .. " + SHIFT + N", hl.dsp.window.resize({ x = 0, y = step, relative = t
|
|||||||
-- The gesture needs three binds, not two. Tab steps the selection, and the
|
-- The gesture needs three binds, not two. Tab steps the selection, and the
|
||||||
-- switch is only COMMITTED when the modifier is released -- which is the sole
|
-- switch is only COMMITTED when the modifier is released -- which is the sole
|
||||||
-- way the compositor can tell the gesture is finished. That release bind is on
|
-- way the compositor can tell the gesture is finished. That release bind is on
|
||||||
-- the bare modifier, so it fires on EVERY Super release in the session; the
|
-- the Super keys themselves, so it fires on EVERY Super release in the
|
||||||
-- handler returns immediately when no switch is open, which is why this is
|
-- session; the handler returns immediately when no switch is open, which is
|
||||||
-- affordable.
|
-- why this is affordable.
|
||||||
--
|
--
|
||||||
-- The release bind carries no description on purpose: it is not a shortcut
|
-- A modifier-only bind has to name the keysym (Super_L / Super_R). Hyprland
|
||||||
-- anyone would look up or rebind, and the Shortcuts page lists what it finds.
|
-- 0.57 rejects a chord that is a bare modifier ("A bind requires a trigger"),
|
||||||
|
-- and the error stops this file, costing every bind below it.
|
||||||
bind(mod .. " + Tab", hl.dsp.exec_cmd(qs("switcher", "next")), { description = "Next window" })
|
bind(mod .. " + Tab", hl.dsp.exec_cmd(qs("switcher", "next")), { description = "Next window" })
|
||||||
bind(mod .. " + SHIFT + Tab", hl.dsp.exec_cmd(qs("switcher", "previous")), { description = "Previous window" })
|
bind(mod .. " + SHIFT + Tab", hl.dsp.exec_cmd(qs("switcher", "previous")), { description = "Previous window" })
|
||||||
bind(mod, hl.dsp.exec_cmd(qs("switcher", "commit")), { release = true, description = "Commit window switch" })
|
for _, key in ipairs({ "Super_L", "Super_R" }) do
|
||||||
|
bind(mod .. " + " .. key, hl.dsp.exec_cmd(qs("switcher", "commit")), { release = true, description = "Commit window switch" })
|
||||||
|
end
|
||||||
-- Jump back to the previously focused window.
|
-- Jump back to the previously focused window.
|
||||||
bind(mod .. " + SHIFT + grave", hl.dsp.focus({ last = true }), { description = "Last window" })
|
bind(mod .. " + SHIFT + grave", hl.dsp.focus({ last = true }), { description = "Last window" })
|
||||||
|
|
||||||
|
|||||||
@@ -487,11 +487,11 @@ Singleton {
|
|||||||
if ((bind.modmask & modifier.bit) !== 0)
|
if ((bind.modmask & modifier.bit) !== 0)
|
||||||
parts.push(modifier.name.toUpperCase());
|
parts.push(modifier.name.toUpperCase());
|
||||||
}
|
}
|
||||||
// A modifier-only bind has no key at all -- the window switcher commits
|
// Guard against a bind with no key. Hyprland 0.57 refuses to create
|
||||||
// on Super RELEASE. Appending an empty string left a dangling "SUPER + "
|
// one (the switcher's Super-release commit now names Super_L/Super_R),
|
||||||
// that matched neither the chord hypr/keybinds.lua binds nor the one an
|
// but appending an empty string would leave a dangling "SUPER + " that
|
||||||
// override would be keyed by, so that bind could never be rebound and
|
// matches neither the chord hypr/keybinds.lua binds nor the one an
|
||||||
// never found its category.
|
// override would be keyed by.
|
||||||
const key = String(bind.key ?? "");
|
const key = String(bind.key ?? "");
|
||||||
if (key !== "")
|
if (key !== "")
|
||||||
parts.push(key);
|
parts.push(key);
|
||||||
|
|||||||
Reference in new issue
Block a user