13
submitted 2 days ago* (last edited 2 days ago) by sinextitan@lemmy.world to c/linux@lemmy.ml

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"

top 6 comments
sorted by: hot top controversial new old

Does anyone know what was up with the removal of Super+J and Super+P to resize the windows? I guess I should have read the notes but every time updates break shit I never seem to have the patience to stop what I'm doing that day and check.

[-] sparkle_matrix_x0x@lemmy.ml 6 points 2 days ago

Try to use

hl.bind(mainMod .. " + ALT + left", hl.dsp.window.resize({x = 20, y = 0}))

IIRC that is the correct syntax, but I haven't checked.

[-] Mordikan@kbin.earth 3 points 2 days ago

Yeah, he needs to use named keys to make that work.

[-] sinextitan@lemmy.world 1 points 2 days ago

yep it is but I had to add relative = 1 for it to work. otherwise was getting a ?:?: Invalid size error.

thanks

[-] Maiq@piefed.social 3 points 2 days ago* (last edited 2 days ago)

Here is what I use. shiftMod is a variable I set up which is just mainMod + Shift

-- Resize Window Horizontal  
hl.bind(shiftMod .. " + left", hl.dsp.window.resize({ x = -40, y = 0, relative = -1, window = activewindow }))  
hl.bind(shiftMod .. " + right", hl.dsp.window.resize({ x = 40, y = 0, relative = 1, window = activewindow }))  
-- Resize Window Vertaclly  
hl.bind(shiftMod .. " + up", hl.dsp.window.resize({ x = 0, y = -40, relative = -1, window = activewindow }))  
hl.bind(shiftMod .. " + down", hl.dsp.window.resize({ x = 0, y = 40, relative = 1, window = activewindow }))  
[-] sinextitan@lemmy.world 2 points 2 days 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

this post was submitted on 29 Jun 2026
13 points (100.0% liked)

Linux

66096 readers
314 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS