so I’m trying to setup binds for Hyprland so that I can resize windows w/o having to use my mouse. the default config comes with mouse resizing (which works). and as my config is based off the default, I copied it and adjusted accordingly to my binds and the wiki.

hl.bind(mainMod .. " + ALT + left",

hl.dsp.window.resize({20,0}))

but it does not work and instead gives me 2 error msgs.

Your config has errors:

=[C]:-1: hl.window.resize: 'x' and 'y' are required

hyprland.lua:327: hl.bind: dispatcher must be a dispatcher (e.g. hl.dsp.window.close()) or a lua function

under hl.dsp.window the wiki contains the resize({ x, y, relative?, window? }) “method”. I can’t figure out if I’m doing smth wrong or just this specific thing is broken.

I asked our benevolent AI mistress but it was too busy bickering and giving me pre 0.55 Hyprlang configs. after I informed the clanker that Hyprland stopped using Hyprlang, it confidentally gave me the wrong Lua config and again w confidence told me to use it. it did not work.

Runtime error in lua:

=[C]:-1: hl.window.resize: 'x' and 'y' are required

EDIT: thanks to @sparkle_matrix_x0x@lemmy.ml and @Maiq@piefed.social, finally figured it out because of them.

here’s my updated config

--Resize windows

hl.bind(altMod .. " + left", hl.dsp.window.resize({x = -20,y = 0, relative = 1}))

hl.bind(altMod .. "+ right", hl.dsp.window.resize({x = 20,y = 0, relative = 1}))

hl.bind(altMod .. "+ up", hl.dsp.window.resize({x = 0,y = -20, relative = 1}))

hl.bind(altMod .. "+ down", hl.dsp.window.resize({x = 0,y = 20, relative = 1}))

btw altMod is a variable I set up which’s basically SUPER+ALT

local altMod = mainMod .. " + ALT"

  • sinextitan@lemmy.worldOP
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    after reading your config I also set up variables for my most used modifier binds. however I omitted window from mine and it seems to work.

    thank you