Hyprland and the change to a lua config file

A screenshot of the w3c web browser, this is a text command line browser.

I use a window manager on my main linux laptop, I find to it helps me to concentrate. The linux build is quite minimal.

Recently hyprland changed its config file to lua. I had been putting it off, but in the end I had to re-write my config file in lua. It was surprisingly straight forward. One thing I could not get working was window resizing using the standard VIM keys.

Screen print of my lua config file for Hyprland

I had a few attempts at trying to resolve this but was struggling to find the command I needed, what I tried always gave me errors. I could not find an example on line every example was for pre-lua, but eventually I found the command:

hl.dsp.window.resize

Yep easy once you know.

So if your searching yourself here are the four lines you need in your Hyprland Config Lua file for resizing windows with the VIM keys.

hl.bind(mainMod .. ” + CTRL +h”, hl.dsp.window.resize({ x = -10, y = 0, relative = true }))

hl.bind(mainMod .. ” + CTRL +l”, hl.dsp.window.resize({ x = 10, y = 0, relative = true }))

hl.bind(mainMod .. ” + CTRL +k”, hl.dsp.window.resize({ x = 0, y = -10, relative = true }))

hl.bind(mainMod .. ” + CTRL +j”, hl.dsp.window.resize({ x = 0, y = 10, relative = true }))

Black haired model with glasses, white blouse and pink jacket. She is sat typing onto a laptop

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.