Window split ratio keybind only works with Dwindle layout
Description
If the tiling layout is changed from Dwindle to Master or Scrolling in:
Settings > Hyprland > Layouts
the default Window Split Ratio keybinds:
SUPER + ;SUPER + '
stop working.
Error message:
Cause
The default illogical-impulse keybinds always use:
hl.dsp.layout("splitratio ...")
but splitratio only works with the Dwindle layout.
The other layouts use different layout messages:
Dwindle → splitratio Master → mfact Scrolling → colresize
Temporary fix
A temporary workaround is to override the keybinds in:
~/.config/hypr/custom/keybinds.lua
and make them detect the active layout before sending the appropriate layout message.
Example:
-- Temporary Custom Window Split ratio keybind fix
hl.unbind("SUPER + Semicolon")
hl.unbind("SUPER + Apostrophe")
local function adjustLayoutRatio(delta)
local layout = hl.get_active_workspace().tiled_layout
local ratioMessage = ({
dwindle = "splitratio",
master = "mfact",
scrolling = "colresize",
})[layout]
if not ratioMessage then
return
end
hl.dispatch(hl.dsp.layout(ratioMessage .. " " .. delta))
end
hl.bind("SUPER + Semicolon", function()
adjustLayoutRatio("-0.1")
end, { repeating = true })
hl.bind("SUPER + Apostrophe", function()
adjustLayoutRatio("+0.1")
end, { repeating = true })
This also safely ignores layouts such as Monocle or unsupported/custom layouts.
Permanent fix
This does not appear to be an issue specific to end4-pC.
The affected default keybind is inherited from the upstream illogical-impulse / end-4 dots-hyprland configuration.
The permanent fix should therefore be applied upstream in illogical-impulse's default hyprland/keybinds.lua, so this custom fork can receive the fix normally through upstream updates.
https://github.com/end-4/dots-hyprland/blob/97c5bc651f68092351b24aaa935af708b1e04514/dots/.config/hypr/hyprland/keybinds.lua#L184-L187
--# Window split ratio
--#/# binde = SUPER, ;/',, -- Adjust split ratio
hl.bind("SUPER + Semicolon", hl.dsp.layout("splitratio -0.1"), { repeating = true })
hl.bind("SUPER + Apostrophe", hl.dsp.layout("splitratio +0.1"), { repeating = true })
P:S Love your custom hyprland theme. It made me motivated to start learning programming again and learn how to use github lol. Would love to contribute furthermore in this fork and can't wait for the Wiki of this
check ~/.config/hypr/hyprland/shellOverrides/main.lua It is where the shell stores the Hyprland configuration; you may have conflicts with what you have in your config. You can delete the import if you do not want to use this. -- Shell overrides -- require("hyprland/shellOverrides/main")
check
~/.config/hypr/hyprland/shellOverrides/main.luaIt is where the shell stores the Hyprland configuration; you may have conflicts with what you have in your config. You can delete the import if you do not want to use this.-- Shell overrides -- require("hyprland/shellOverrides/main")
i took a look of my current ~/.config/hypr/hyprland/shellOverrides/main.lua and i don't seem to see any conflicts that could be related to the issue.
Altho i do notice this line hl.config({ general = { layout = "master" } }) also correspond to what tiling layout the user selected.
-- DO NOT EDIT THIS FILE. IT IS MANAGED BY THE SHELL AND FOLLOWS STRICT RULES
-- In other words, I ain't writing a lua parser for this, so please be a good boi/girl/whatever
hl.config({ decoration = { blur = { size = 1 } } })
hl.config({ decoration = { blur = { passes = 3 } } })
hl.config({ decoration = { active_opacity = 1 } })
hl.config({ decoration = { inactive_opacity = 1 } })
hl.config({ general = { layout = "master" } })
hl.config({ input = { kb_layout = "us" } })
hl.config({ input = { numlock_by_default = true } })
hl.config({ input = { repeat_delay = 250 } })
hl.config({ input = { repeat_rate = 35 } })
hl.config({ input = { follow_mouse = 2 } })
hl.config({ input = { touchpad = { natural_scroll = false } } })
hl.config({ input = { touchpad = { disable_while_typing = false } } })
hl.config({ input = { touchpad = { clickfinger_behavior = false } } })
hl.config({ input = { touchpad = { scroll_factor = 0.7 } } })
hl.config({ decoration = { rounding = 22 } })
hl.config({ decoration = { blur = { enabled = true } } })
hl.config({ general = { border_size = 1 } })
hl.config({ general = { gaps_in = 2 } })
hl.config({ general = { gaps_out = 5 } })
hl.config({ animations = { enabled = true } })
Seeing your screenshot I don't know what config you are using I don't put messages like that in my config
Seeing your screenshot I don't know what config you are using I don't put messages like that in my config
I'm not sure sure this is what you mean with what config i am using but i am using the Hyprland config from the illogical-impulse installation, with end4-pC as the Quickshell config because it's said on the README installation of your end4-pC custom fork that "it does require illogical-impulse to be installed and running. " . I haven't replaced the default ~/.config/hypr/hyprland/keybinds.lua.
I don't put messages like that in my config You mean this comment in the
main.lua?
-- DO NOT EDIT THIS FILE. IT IS MANAGED BY THE SHELL AND FOLLOWS STRICT RULES
-- In other words, I ain't writing a lua parser for this, so please be a good boi/girl/whatever
Isn't this suppose to be from the illogical-impulse? https://github.com/end-4/dots-hyprland/blob/97c5bc651f68092351b24aaa935af708b1e04514/dots/.config/hypr/hyprland/shellOverrides/main.lua#L1-L2
demo of the issue and the temporary applied fix. https://github.com/user-attachments/assets/667119ab-6ba1-4986-9269-2068ec4656ee