4

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.

nicmus
  • 143
  • 1
  • 5

2 Answers2

8

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),
4

An easier way is awful.placement if you are using 4.0 version. Otherwise manually set client geometry seems like most reliable way to make such alignment.

Worron
  • 181
  • 3
  • Thanks! I was expecting to find these kind of operations in the class awful.client. It would be nice to have a global search function in the awesome apidoc. – nicmus Feb 04 '17 at 07:54