Skip to content

Window split ratio keybind only works with Dwindle layout #90

Description

@nezumo-tan

Description

If the tiling layout is changed from Dwindle to Master or Scrolling in:

Settings > Hyprland > Layouts

Image

the default Window Split Ratio keybinds:

  • SUPER + ;
  • SUPER + '

stop working.

Error message:

Image

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 })

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions