Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

awesome-wm: move floating client to the center of screen

Tags:

awesome-wm

In Awesome WM is there a way to bind a key combination to move the focused floating client to the center of the screen? (the client should be neither maximized nor fullscreen)

I was checking the documentation but apparently there is not such a function.

So as an alternative I was thinking to get the current screen width and height and then set the x and y properties of the client accordingly (taking into account also the width and height of the client itself).

I'd like to know if there is an easier way to perform the same action.

like image 444
nicmus Avatar asked Oct 26 '25 14:10

nicmus


1 Answers

To complement Worron answer, you need to use the placement API

https://awesomewm.org/apidoc/libraries/awful.placement.html

Add a keybinding in the clientkeys table. It will look like:

awful.key({ modkey, "Shift"   }, "y", awful.placement.centered),
like image 134
Emmanuel Lepage Vallee Avatar answered Oct 28 '25 07:10

Emmanuel Lepage Vallee