简体   繁体   中英

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

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM